GLib.OptionContext.prototype.parse_strv

function parse_strv(arguments: Array(String)): [ok: Boolean, arguments: Array(String)] {
    // Gjs wrapper for g_option_context_parse_strv()
}
  

Parses the command line arguments.

This function is similar to GLib.OptionContext.prototype.parse except that it respects the normal memory rules when dealing with a strv instead of assuming that the passed-in array is the argv of the main function.

In particular, strings that are removed from the arguments list will be freed using GLib.free.

On Windows, the strings are expected to be in UTF-8. This is in contrast to GLib.OptionContext.prototype.parse which expects them to be in the system codepage, which is how they are passed as @argv to main(). See g_win32_get_command_line() for a solution.

This function is useful if you are trying to use GLib.OptionContext with #GApplication.

Since 2.40

arguments

a pointer to the command line arguments (which must be in UTF-8 on Windows)

ok

true if the parsing was successful, false if an error occurred

arguments (out)

a pointer to the command line arguments (which must be in UTF-8 on Windows)