mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-05 07:34:40 +00:00
Update README.md
This commit is contained in:
parent
b3c83177e4
commit
48c6365ef5
@ -112,6 +112,15 @@ Here's what's happening:
|
|||||||
- argv is further parsed to identify the inputs mapped to ```-c```.
|
- argv is further parsed to identify the inputs mapped to ```-c```.
|
||||||
* Using ```-cab``` will throw an error since argparse expects two inputs for the argument ```-c```.
|
* Using ```-cab``` will throw an error since argparse expects two inputs for the argument ```-c```.
|
||||||
|
|
||||||
|
Notice how argparse is able to quietly and peacefully return an std::vector<float> when asked for it.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
auto c_vector = program.get<std::vector<float>>("-c");
|
||||||
|
auto c_list = program.get<std::list<float>>("-c");
|
||||||
|
```
|
||||||
|
|
||||||
|
Both of these above statements will work. Argparse has specializations implemented for both ```std::vector``` and ```std::list```.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Positional Arguments
|
### Positional Arguments
|
||||||
|
Loading…
Reference in New Issue
Block a user