- a struct this for initialising the commandline options.
- */
-struct Long_option_init {
- char const * take_arg_str0_;
- char const * longname_str0_;
+ a struct this for initialising the commandline options.
+*/
+struct Long_option_init
+{
+ char const *take_arg_str0_;
+ char const *longname_str0_;
- > 255: don't take short version.
- */
- int shortname_char_;
-
- char const * help_str0_;
-
- String to_string () const;
- String str_for_help () const;
+ = 0: don't take short version.
+ */
+ char shortname_char_;
+
+ char const *help_str0_;
+
+ string to_string () const;
+ string str_for_help () const;
- static int compare (Long_option_init const&,Long_option_init const&);
- static String table_string (Long_option_init *);
+ static int compare (Long_option_init const &, Long_option_init const &);
+ static string table_string (Long_option_init *);
- line arguments. No pointer (return values, arguments) contents are
- copied.
-
- TODO: handle
- command - , and command --
-
- argument reordering
- */
-class Getopt_long {
+ line arguments. No pointer (return values, arguments) contents are
+ copied.
+
+ TODO: handle
+ command - , and command --
+
+ argument reordering
+*/
+class Getopt_long
+{
/// if doing short option, arg_value_char_a_a_[optind][optindind] is processed next.
int argument_index_;
/// the option found
const Long_option_init *found_option_;
/// if doing short option, arg_value_char_a_a_[optind][optindind] is processed next.
int argument_index_;
/// the option found
const Long_option_init *found_option_;
/** errorcodes: no error, argument expected, no argument expected,
/** errorcodes: no error, argument expected, no argument expected,
enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
- What to do with errors.
- report messages on #*os#, and abort.
- if #os# is null, then do not report nor abort, just set #error#
- */
-
+ What to do with errors.
+ report messages on #*os#, and abort.
+ if #os# is null, then do not report nor abort, just set #error#
+ */
+
- /** get the next option.
- @return pointer to next option found.
- 0 if error occurred, or next argument is no option.
- */
+ /** get the next option.
+ @return pointer to next option found.
+ 0 if error occurred, or next argument is no option.
+ */