Package: glib

Function g-option-context-parse

Lambda List

g-option-context-parse (context &rest argv)

Arguments

context -- a g-option-context instance
argv -- a list of strings with the command line arguments

Return Value

True if the parsing was successful, false if an error occurred.

Details

Parses the command line arguments, recognizing options which have been added to context. A side-effect of calling this function is that the g-prgname function will be called.

If the parsing is successful, any parsed arguments are removed from the list and argv is updated accordingly. A -- option is stripped from argv unless there are unparsed options before and after it, or some of the options after it start with -. In case of an error, argv is left unmodified.

If automatic --help support is enabled, see the g-option-context-help-enabled function, and the argv list contains one of the recognized help options, this function will produce help output to stdout and call exit(0).

Note that function depends on the current locale for automatic character set conversion of string and filename arguments.
 

See also

2021-9-18