Commit 726a970299a9586ded627145d71cd7ff2a361498

Authored by Henry Schreiner
Committed by GitHub
1 parent 0908251c

Cleanup macro mention

Showing 1 changed file with 1 additions and 5 deletions
README.md
... ... @@ -101,11 +101,7 @@ try {
101 101 }
102 102 ```
103 103  
104   -> Note: The final five lines are so common, they have a dedicated macro:
105   ->
106   -> ```cpp
107   -CLI11_PARSE(app, argc, argv)
108   -```
  104 +> Note: The final five lines are so common, they have a dedicated macro: `CLI11_PARSE(app, argc, argv)`. You can use that as long as you don't need the return value of `.parse`.
109 105  
110 106  
111 107 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")`.
... ...