![]() |
![]() |
Public Member Functions | |
OptionContext (const Glib::ustring& parameter_string=Glib::ustring()) | |
OptionContext (GOptionContext* castitem, bool take_ownership=false) | |
virtual | ~OptionContext () |
void | set_help_enabled (bool help_enabled=true) |
Enables or disables automatic generation of <option>--help</option> output. | |
bool | get_help_enabled () const |
Returns whether automatic <option>--help</option> generation is turned on for context . | |
void | set_ignore_unknown_options (bool ignore_unknown=true) |
Sets whether to ignore unknown options or not. | |
bool | get_ignore_unknown_options () const |
Returns whether unknown options are ignored or not. | |
bool | parse (int& argc, char**& argv) |
Parses the command line arguments, recognizing options which have been added to context . | |
void | add_group (OptionGroup& group) |
void | set_main_group (OptionGroup& group) |
GOptionContext* | gobj () |
const GOptionContext* | gobj () const |
Protected Attributes | |
GOptionContext* | gobject_ |
bool | has_ownership_ |
|
|
|
|
|
|
|
|
|
Returns whether automatic <option>--help</option> generation is turned on for context . See g_option_context_set_help_enabled().
|
|
Returns whether unknown options are ignored or not. See g_option_context_set_ignore_unknown_options().
|
|
|
|
|
|
Parses the command line arguments, recognizing options which have been added to context . A side-effect of calling this function is that g_set_prgname() will be called. If the parsing is successful, any parsed arguments are removed from the array and argc and argv are updated accordingly. In case of an error, argc and argv are left unmodified.
If automatic <option>--help</option> support is enabled (see g_option_context_set_help_enabled()), and the argv array contains one of the recognized help options, this function will produce help output to stdout and call
|
|
Enables or disables automatic generation of <option>--help</option> output. By default, g_option_context_parse() recognizes <option>--help</option>, <option>-?</option>, <option>--help-all</option> and <option>--help-</option><replaceable>groupname</replaceable> and creates suitable output to stdout. Since: 2.6
|
|
Sets whether to ignore unknown options or not. If an argument is ignored, it is left in the argv array after parsing. By default, g_option_context_parse() treats unknown options as error. This setting does not affect non-option arguments (i.e. arguments which don't start with a dash). But note that GOption cannot reliably determine whether a non-option belongs to a preceding unknown option. Since: 2.6
|
|
|
|
|
|
|