Update README.md

This commit is contained in:
Pranav Srinivas Kumar 2019-03-31 17:21:25 -04:00 committed by GitHub
parent cb69613899
commit 216530e330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,8 @@ argparse::ArgumentParser program("program name");
Argparse supports a variety of argument types including positional arguments, optional arguments, toggle arguments and compound arguments.
### Positional Arguments
Here's an example of a ***positional argument***:
```cpp
@ -48,6 +50,8 @@ Here's what's happening:
* The parse_args() method parses the arguments provided, converts our input into an integer and returns the square.
* We can get the value stored by the parser for a given argument using ```parser.get<T>(key)``` method.
### Optional Arguments
Now, let's look at ***optional arguments***. Optional arguments start with ```-``` or ```--```, e.g., "--verbose" or "-a". Optional arguments can be placed anywhere in the input sequence.