arg  1.2
a C++ command-line parser
arg_ex0.cc

Simplest example using the arg library

#include <arg.hh>
#include <iostream>
int main(int argc, char ** argv)
{
int n;
p.add_opt('n').stow(n = -1);
p.parse(argc, argv);
std::cout << n << '\n';
return 0;
}
arg::Parser
The command-line parser.
Definition: arg.hh:129
arg::Parser::add_opt
Option & add_opt(int key, std::string const &name="", bool hide=false)
add an Option
Definition: arg.cc:268
arg::Parser::parse
void parse(int argc, char *argv[], bool ignore_unknown=false)
perform command-line parsing
Definition: arg.cc:292
arg::Option::stow
Option & stow(T &t)
stow value to streamable variable
Definition: arg.hh:271
arg.hh
Header file for arg library.