Skip to content

Commit

Permalink
Cleanup macro mention
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored Sep 7, 2017
1 parent 0908251 commit 726a970
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ try {
}
```

> Note: The final five lines are so common, they have a dedicated macro:
>
> ```cpp
CLI11_PARSE(app, argc, argv)
```
> 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`.

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")`.
Expand Down

0 comments on commit 726a970

Please sign in to comment.