Update README.md

This commit is contained in:
Pranav Srinivas Kumar 2019-03-30 19:43:02 -04:00 committed by GitHub
parent 2e1683d7cb
commit fad02831be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,17 +8,17 @@
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
argparse::ArgumentParser program("main"); argparse::ArgumentParser program("main");
program.add_argument("config") program.add_argument("--config")
.help("configuration file") .help("configuration file")
.default_value([]() { return "config.yml" }); .default_value(std::string("config.yml"));
program.add_argument("n", "-n", "--num_iterations") program.add_argument("-n", "--num_iterations")
.help("The list of input files") .help("The list of input files")
.action([](const std::string& value) { return std::stoi(value); }); .action([](const std::string& value) { return std::stoi(value); });
program.parse(argc, argv); program.parse(argc, argv);
std::string config = program.get("config"); std::string config = program.get("--config");
int num_iterations = program.get<int>("n"); int num_iterations = program.get<int>("-n");
return 0; return 0;
} }