57 while (declarations[
Mnopt].opt_string != NULL) {
Mnopt++; }
62 struct option* long_options=
new struct option[
Mnopt];
70 while (declarations[iopt].opt_string != NULL)
72 long_options[iopt].name =declarations[iopt].opt_string;
73 long_options[iopt].has_arg =declarations[iopt].opt_arg_mode;
74 long_options[iopt].flag =NULL;
75 long_options[iopt].val =iopt;
77 Mresult[iopt].
arg =std::string(declarations[iopt].arg_default);
87 c=getopt_long_only(iargc, argv,
"", long_options, &iopt);
94 if ((c < 0) || (c >=
Mnopt))
96 std::cerr <<
"Commandline: ERROR on option '" 97 << long_options[iopt].name <<
"'" << std::endl;
112 delete[] long_options;
Result * Mresult
Array of command line contents.
bool opt_set
true if option was used on command line
char ** Margv
Pointer to array of command line strings (as passed to main)
int Mnopt
Total number of options evaluated ot Mresult.
int Miargc
Number of command line strings (as passed to main)
int Moptind
Next option string to read after last defined option.
std::string arg
holds option argument
#define TFXX_abort(M)
Abort and give a message.