Package: glib

Function g-option-context-parse-strv

Lambda List

g-option-context-parse-strv (context arguments)

Arguments

context -- a g-option-context instance
arguments -- a list of strings with the command line arguments, which must be in UTF-8 on Windows, starting with GLib 2.62, arguments can be nil, which matches the g-option-context-parse function

Return Value

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

Details

Parses the command line arguments.

This function is similar to the g-option-context-parse function except that it respects the normal memory rules when dealing with a list of strings instead of assuming that the passed-in list are the command line arguments of the main function.

In particular, strings that are removed from the arguments list will be freed using the g_free() function.

On Windows, the strings are expected to be in UTF-8. This is in contrast to the g-option-context-parse function which expects them to be in the system codepage, which is how they are passed as the command line arguments to the main function. See the g_win32_get_command_line() function for a solution.

This function is useful if you are trying to use a g-option-context instance with a g-application instance.
 

See also

2021-9-18