This commit is contained in:
Pranav Srinivas Kumar 2019-04-01 21:44:18 -04:00
commit 5bf9b958f6

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: