9 struct long_option_init
{
14 ostream
&printon(ostream
&errorout
);
18 /** C++ for version of long_getopt. For processing GNU style command
19 line arguments. No pointer (return values, arguments) contents are
23 /** errorcodes: no error, argument expected, no argument expected,
24 unknown option, illegal argument (eg. int expected). */
25 enum Errorcod
{ E_NOERROR
= 0, E_ARGEXPECT
, E_NOARGEXPECT
, E_UNKNOWNOPTION
,
32 long_option_init
*the_opts
;
35 /// if doing short option, argv[optind][optindind] is processed next.
39 long_option_init
*beet
;
41 /// get ready for processing next error.
43 long_option_init
*parselong();
44 long_option_init
*parseshort();
48 /// report an error and abort
49 void report(Errorcod c
);
51 /** what to do with errors.
52 report messages on #*os#, and abort.
53 if #os# is null, then do not report nor abort, just set #error#
56 void seterror(ostream
*os
);
57 /// argument. Set to 0 if not present
61 /// return an integer (with err. detect)
63 /// argv[optind] will be processed next.
72 /// construct: pass arguments and option info.
73 Getopt_long(int c
, char **v
, long_option_init
*lo
);
75 /** get the next option.
76 @return pointer to next option found.
77 0 if error occurred, or next argument is no option.
79 long_option_init
*operator()();
82 char * get_next_arg();