Update README.md

This commit is contained in:
Pranav Srinivas Kumar 2019-04-01 21:43:55 -04:00 committed by GitHub
parent 63a6763489
commit 2bc003018d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,10 +29,10 @@ Here's an example of a ***positional argument***:
```cpp ```cpp
program.add_argument("square") program.add_argument("square")
.help("display the square of a given integer") .help("display the square of a given integer")
.action([](const std::string& value) { auto integer = std::stoi(value); return integer * integer; }); .action([](const std::string& value) { return pow(std::stoi(value), 2); });
program.parse_args(argc, argv); program.parse_args(argc, argv);
std::cout << program.get<int>("square") << std::endl; std::cout << program.get<double>("square") << std::endl;
``` ```
And running the code: And running the code: