Application.addMainOption

Add an option to be handled by application.

Calling this function is the equivalent of calling Application.addMainOptionEntries with a single GOptionEntry that has its arg_data member set to NULL.

The parsed arguments will be packed into a glib.VariantDict which is passed to handle-local-options. If G_APPLICATION_HANDLES_COMMAND_LINE is set, then it will also be sent to the primary instance. See Application.addMainOptionEntries for more details.

See GOptionEntry for more documentation of the arguments.

class Application
void
addMainOption

Parameters

longName string

the long name of an option used to specify it in a commandline

shortName char

the short name of an option

flags GOptionFlags

flags from GOptionFlags

arg GOptionArg

the type of the option, as a GOptionArg

description string

the description for the option in --help output

argDescription string

the placeholder to use for the extra argument parsed by the option in --help output

Meta

Since

2.42