mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-05 15:44:40 +00:00
Update README.md
This commit is contained in:
parent
4245c1a850
commit
d27c0813cc
16
README.md
16
README.md
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user