Application.addMainOption

void addMainOption(string longName, char shortName, glib.types.OptionFlags flags, glib.types.OptionArg arg, string description, string argDescription = null)

Add an option to be handled by application.

Calling this function is the equivalent of calling [gio.application.Application.addMainOptionEntries] with a single #GOptionEntry that has its arg_data member set to null.

The parsed arguments will be packed into a #GVariantDict which is passed to #GApplication::handle-local-options. If [gio.types.ApplicationFlags.HandlesCommandLine] is set, then it will also be sent to the primary instance. See [gio.application.Application.addMainOptionEntries] for more details.

See #GOptionEntry for more documentation of the arguments.

Parameters

longNamethe long name of an option used to specify it in a commandline
shortNamethe short name of an option
flagsflags from #GOptionFlags
argthe type of the option, as a #GOptionArg
descriptionthe description for the option in --help output
argDescriptionthe placeholder to use for the extra argument parsed by the option in --help output