From d27c0813cc7a52fc1f16512ea305bc4da38a92b4 Mon Sep 17 00:00:00 2001 From: Pranav Srinivas Kumar Date: Sun, 31 Mar 2019 10:39:25 -0400 Subject: [PATCH] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0cf744..9f0058a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,21 @@ program.parse_args({"./main", "--input_files", "config.yml", "System.xml"}); auto files = program.get>("--input_files"); // {"config.yml", "System.xml"} ``` -## Compound Toggle Arguments +## Toggle Arguments + +```cpp +argparse::ArgumentParser program("test"); + +program.add_argument("--verbose", "-v") + .default_value(false) + .implicit_value(true); + +program.parse_args({ "./main", "--verbose" }); + +auto a = program.get("--verbose"); // true +``` + +## Compound Arguments ```cpp argparse::ArgumentParser program("test");