MCPcopy Create free account
hub / github.com/adishavit/argh / main

Function main

example.cpp:7–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "argh.h"
6
7int main(int argc, char* argv[])
8{
9 argh::parser cmdl;
10 cmdl.parse(argc, argv, argh::parser::PREFER_PARAM_FOR_UNREG_OPTION);
11
12 if (cmdl["-v"])
13 cout << "Verbose, I am." << endl;
14
15 cout << "Positional args:\n";
16 for (auto& pos_arg : cmdl)
17 cout << '\t' << pos_arg << endl;
18
19 cout << "Positional args:\n";
20 for (auto& pos_arg : cmdl.pos_args())
21 cout << '\t' << pos_arg << endl;
22
23 cout << "\nFlags:\n";
24 for (auto& flag : cmdl.flags())
25 cout << '\t' << flag << endl;
26
27 cout << "\nParameters:\n";
28 for (auto& param : cmdl.params())
29 cout << '\t' << param.first << " : " << param.second << endl;
30
31 return EXIT_SUCCESS;
32}

Callers

nothing calls this directly

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected