mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Merge pull request #361 from RichardBrown384/rbrown/correct-readme
Correct Parent Parser errors in README.md
This commit is contained in:
commit
e462ab980c
@ -799,8 +799,8 @@ A parser may use arguments that could be used by other parsers.
|
|||||||
These shared arguments can be added to a parser which is then used as a "parent" for parsers which also need those arguments. One or more parent parsers may be added to a parser with `.add_parents`. The positional and optional arguments in each parent is added to the child parser.
|
These shared arguments can be added to a parser which is then used as a "parent" for parsers which also need those arguments. One or more parent parsers may be added to a parser with `.add_parents`. The positional and optional arguments in each parent is added to the child parser.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
argparse::ArgumentParser surface_parser("surface", 1.0, argparse::default_arguments::none);
|
argparse::ArgumentParser surface_parser("surface", "1.0", argparse::default_arguments::none);
|
||||||
parent_parser.add_argument("--area")
|
surface_parser.add_argument("--area")
|
||||||
.default_value(0)
|
.default_value(0)
|
||||||
.scan<'i', int>();
|
.scan<'i', int>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user