From 5cceb98e3c1f5cf23d3323853062e4b59086381b Mon Sep 17 00:00:00 2001 From: Sean Robinson Date: Tue, 26 Oct 2021 12:58:24 -0700 Subject: [PATCH] Update "Printing Help" documentation 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 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6801047e..f2561a32 100644 --- a/README.md +++ b/README.md @@ -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") @@ -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()`.