Update README.md

This commit is contained in:
Pranav Srinivas Kumar 2019-03-31 10:39:25 -04:00 committed by GitHub
parent 4245c1a850
commit d27c0813cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,21 @@ program.parse_args({"./main", "--input_files", "config.yml", "System.xml"});
auto files = program.get<std::vector<std::string>>("--input_files"); // {"config.yml", "System.xml"} auto files = program.get<std::vector<std::string>>("--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<bool>("--verbose"); // true
```
## Compound Arguments
```cpp ```cpp
argparse::ArgumentParser program("test"); argparse::ArgumentParser program("test");