Update README.md

This commit is contained in:
Pranav Srinivas Kumar 2019-09-10 10:15:15 -05:00 committed by GitHub
parent acfa32e5c1
commit 61e9b644c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,7 @@ Here's what's happening:
There are scenarios where you would like to make an optional argument ***required***. As discussed above, optional arguments either begin with `-` or `--`. You can make these types of arguments required like so:
```cpp
program.add_argument("-o", "--output")
program.add_argument("-o", "--output")
.required()
.help("specify the output file.");
```
@ -134,7 +134,7 @@ If the user does not provide a value for this parameter, an exception is thrown.
Alternatively, you could provide a default value like so:
```cpp
program.add_argument("-o", "--output")
program.add_argument("-o", "--output")
.default_value(std::string("-"))
.required()
.help("specify the output file.");