Commit aec97a6f53c3486fc51e0d9857f10b683180d668
1 parent
5a758502
update readme
Showing
1 changed file
with
12 additions
and
3 deletions
README.md
| ... | ... | @@ -24,7 +24,7 @@ Create a cxxopts::Options instance. |
| 24 | 24 | |
| 25 | 25 | cxxopts::Options options; |
| 26 | 26 | |
| 27 | -Then use add_options. | |
| 27 | +Then use `add_options`. | |
| 28 | 28 | |
| 29 | 29 | options.add_options() |
| 30 | 30 | ("d,debug", "Enable debugging") |
| ... | ... | @@ -46,13 +46,22 @@ it appeared, and |
| 46 | 46 | to get its value. If "opt" doesn't exist, or isn't of the right type, then an |
| 47 | 47 | exception will be thrown. |
| 48 | 48 | |
| 49 | +## Help groups | |
| 50 | + | |
| 51 | +Options can be placed into groups for the purposes of displaying help messages. | |
| 52 | +To place options in a group, pass the group as a string to `add_options`. Then, | |
| 53 | +when displaying the help, pass the groups that you would like displayed as a | |
| 54 | +vector to the `help` function. | |
| 55 | + | |
| 49 | 56 | ## Positional Arguments |
| 50 | 57 | |
| 51 | -Positional arguments can be optionally parsed into one or more options. To set up positional arguments, call | |
| 58 | +Positional arguments can be optionally parsed into one or more options. | |
| 59 | +To set up positional arguments, call | |
| 52 | 60 | |
| 53 | 61 | options.parse_positional({"first", "second", "last"}) |
| 54 | 62 | |
| 55 | -where "last" should be the name of an option with a container type, and the others should have a single value. | |
| 63 | +where "last" should be the name of an option with a container type, and the | |
| 64 | +others should have a single value. | |
| 56 | 65 | |
| 57 | 66 | # Linking |
| 58 | 67 | ... | ... |