10 a struct this for initialising the commandline options.
12 struct Long_option_init {
14 char const * longname;
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 command - , and command --
32 /** errorcodes: no error, argument expected, no argument expected,
33 unknown option, illegal argument (eg. int expected). */
34 enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
41 Long_option_init *the_opts;
44 /// if doing short option, argv[optind][optindind] is processed next.
48 Long_option_init *beet;
50 /// get ready for processing next error.
52 Long_option_init *parselong();
53 Long_option_init *parseshort();
57 /// report an error and abort
58 void report(Errorcod c);
61 /// argument. Set to 0 if not present
64 /// current error status
67 /// return an integer (with err. detect)
69 /// argv[optind] will be processed next.
81 What to do with errors.
82 report messages on #*os#, and abort.
83 if #os# is null, then do not report nor abort, just set #error#
86 void seterror(ostream *os);
88 /// construct: pass arguments and option info.
89 Getopt_long(int c, char **v, Long_option_init *lo);
91 /** get the next option.
92 @return pointer to next option found.
93 0 if error occurred, or next argument is no option.
95 Long_option_init *operator()();
98 char * get_next_arg();