Proton  1.1.1
Make porting easy from Python to C++11
getopt

get options More...

Functions

std::tuple< vector_
< std::tuple< str, str >
>, vector_< str > > 
proton::getopt (int argc, char *const argv[], const str &optstr, const vector_< str > &longopt={})
 like getopt in python.

Detailed Description

get options


Function Documentation

std::tuple<vector_<std::tuple<str, str> >, vector_<str> > proton::getopt ( int  argc,
char *const  argv[],
const str &  optstr 
)

like getopt in python.

Note: the prototype above is wrong due to some bugs of doxygen, use the prototype in the function list (above the "detailed description" line).

Parameters:
argcargc in main()
argvargv in main()
optstrthe option string
longoptthe long option arrays
Returns:
([(option, value)], [args])
Exceptions:
std::invalid_argument
Examples:
getopt.cpp.