10 a struct this for initialising the commandline options.
12 struct Long_option_init {
17 ostream &printon(ostream &errorout);
21 /** C++ for version of long_getopt. For processing GNU style command
22 line arguments. No pointer (return values, arguments) contents are
26 /** errorcodes: no error, argument expected, no argument expected,
27 unknown option, illegal argument (eg. int expected). */
28 enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
35 Long_option_init *the_opts;
38 /// if doing short option, argv[optind][optindind] is processed next.
42 Long_option_init *beet;
44 /// get ready for processing next error.
46 Long_option_init *parselong();
47 Long_option_init *parseshort();
51 /// report an error and abort
52 void report(Errorcod c);
55 /// argument. Set to 0 if not present
58 /// current error status
61 /// return an integer (with err. detect)
63 /// argv[optind] will be processed next.
75 What to do with errors.
76 report messages on #*os#, and abort.
77 if #os# is null, then do not report nor abort, just set #error#
80 void seterror(ostream *os);
82 /// construct: pass arguments and option info.
83 Getopt_long(int c, char **v, Long_option_init *lo);
85 /** get the next option.
86 @return pointer to next option found.
87 0 if error occurred, or next argument is no option.
89 Long_option_init *operator()();
92 char * get_next_arg();