diff --git a/README.md b/README.md index 0b063c7..27ff6c3 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,20 @@ Argparse supports a variety of argument types including positional, optional, an Here's an example of a ***positional argument***: ```cpp -program.add_argument("square") - .help("display the square of a given integer") - .action([](const std::string& value) { return pow(std::stoi(value), 2); }); +#include -program.parse_args(argc, argv); -std::cout << program.get("square") << std::endl; +int main(int argc, char *argv[]) { + argparse::ArgumentParser program("program name"); + + program.add_argument("square") + .help("display the square of a given integer") + .action([](const std::string& value) { return pow(std::stoi(value), 2); }); + + program.parse_args(argc, argv); + std::cout << program.get("square") << std::endl; + + return 0; +} ``` And running the code: