Skip to content

Commit

Permalink
Update "Printing Help" documentation
Browse files Browse the repository at this point in the history
Help output has changed format over time.  This updates the README
example to reflect current practice by running the example code
and copy-pasting its output.

Signed-off-by: Sean Robinson <[email protected]>
  • Loading branch information
skrobinson committed Oct 27, 2021
1 parent ea1f7ef commit 5cceb98
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ As you can see here, ```argparse``` supports negative integers, negative floats
### Combining Positional and Optional Arguments

```cpp
argparse::ArgumentParser program("test");
argparse::ArgumentParser program("main");

program.add_argument("square")
.help("display the square of a given number")
Expand Down Expand Up @@ -303,14 +303,15 @@ The square of 4 is 16

```
$ ./main --help
Usage: ./main [options] square
Usage: main [options] square
Positional arguments:
square display a square of a given number
square display the square of a given number
Optional arguments:
-h, --help show this help message and exit
-v, --verbose enable verbose logging
-h --help shows help message and exits [default: false]
-v --version prints version information and exits [default: false]
--verbose [default: false]
```

You may also get the help message in string via `program.help().str()`.
Expand Down

0 comments on commit 5cceb98

Please sign in to comment.