Application.addOptionGroup

Adds a glib.OptionGroup to the commandline handling of application.

This function is comparable to OptionContext.addGroup.

Unlike Application.addMainOptionEntries, this function does not deal with NULL arg_data and never transmits options to the primary instance.

The reason for that is because, by the time the options arrive at the primary instance, it is typically too late to do anything with them. Taking the GTK option group as an example: GTK will already have been initialised by the time the command-line handler runs. In the case that this is not the first-running instance of the application, the existing instance may already have been running for a very long time.

This means that the options from glib.OptionGroup are only really usable in the case that the instance of the application being run is the first instance. Passing options like --display= or --gdk-debug= on future runs will have no effect on the existing primary instance.

Calling this function will cause the options in the supplied option group to be parsed, but it does not cause you to be "opted in" to the new functionality whereby unrecognised options are rejected even if G_APPLICATION_HANDLES_COMMAND_LINE was given.

class Application
void
addOptionGroup

Parameters

group OptionGroup

Meta

Since

2.40