Commit 90a02425f06391716e5e2b43e82a6a0a42818be4

Authored by Henry Fredrick Schreiner
1 parent a6621ff8

Match docs to recent changes

README.md
... ... @@ -16,7 +16,7 @@ An acceptable CLI parser library should be all of the following:
16 16  
17 17 * Easy to include (i.e., header only, one file if possible, no external requirements): While many programs depend on Boost, that should not be a requirement if all you want is CLI parsing.
18 18 * Short Syntax: This is one of the main points of a CLI parser, it should make variables from the command line nearly as easy to define as any other variables. If most of your program is hidden in CLI parsing, this is a problem for readability.
19   -* C++11 or better: Should work with GCC 4.7+ (such as GCC 4.8 on CentOS 7) or above, or Clang 3.5+, or MSVC 2015+. (Note: for CLI11, Clang 3.4 only fails because of tests, googlemock does not support it.)
  19 +* C++11 or better: Should work with GCC 4.7+ (such as GCC 4.8 on CentOS 7) or above, or Clang 3.5+, or MSVC 2015+. (Note: for CLI11, Clang 3.4 only fails because of tests, GoogleMock does not support it.)
20 20 * Work on Linux, macOS, and Windows.
21 21 * Well tested using [Travis][travis-link] (Linux and macOS) and [AppVeyor][appveyor-link] (Windows). "Well" is defined as having good coverage measured by [CodeCov][codecov-link].
22 22 * Clear help printing.
... ... @@ -91,7 +91,7 @@ try {
91 91 }
92 92 ```
93 93  
94   -The initialization is just one line, adding options is just two each. The try/catch block ensures that `-h,--help` or a parse error will exit with the correct return code. (The return here should be inside `main`). After the app runs, the filename will be set to the correct value if it was passed, otherwise it will be set to the default. You can check to see if this was passed on the command line with `app.count("--file")`.
  94 +The initialization is just one line, adding options is just two each. The try/catch block ensures that `-h,--help` or a parse error will exit with the correct return code (selected from `CLI::ExitCodes`). (The return here should be inside `main`). After the app runs, the filename will be set to the correct value if it was passed, otherwise it will be set to the default. You can check to see if this was passed on the command line with `app.count("--file")`.
95 95  
96 96 The supported values are:
97 97  
... ... @@ -246,7 +246,7 @@ std::atexit([](){std::cout << rang::style::reset;});
246 246 try {
247 247 app.parse(argc, argv);
248 248 } catch (const CLI::ParseError &e) {
249   - std::cout << (e.exit_code==0 ? rang::fg::blue : rang::fg::red);
  249 + std::cout << (e.get_exit_code()==0 ? rang::fg::blue : rang::fg::red);
250 250 return app.exit(e);
251 251 }
252 252 ```
... ...
docs/mainpage.md
... ... @@ -8,6 +8,7 @@ The main classes are:
8 8 |---------------|-------------------------------------|
9 9 |CLI::Option | Options, stored in the app |
10 10 |CLI::App | The main application or subcommands |
  11 +|CLI::ExitCodes | A scoped enum with exit codes |
11 12  
12 13  
13 14 Groups of related topics:
... ...
include/CLI/Error.hpp
... ... @@ -9,6 +9,7 @@
9 9  
10 10 namespace CLI {
11 11  
  12 +/// These codes are part of every error in CLI. They can be obtained from e using e.exit_code or as a quick shortcut, int values from e.get_error_code().
12 13 enum class ExitCodes {
13 14 Success = 0,
14 15 IncorrectConstruction=100,
... ...