add_main_option


Description:

[ Version ( since = "2.42" ) ]
public void add_main_option (string long_name, char short_name, OptionFlags flags, OptionArg arg, string description, string? arg_description)

Add an option to be handled by this.

Calling this function is the equivalent of calling add_main_option_entries with a single OptionEntry that has its arg_data member set to null.

The parsed arguments will be packed into a 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 add_main_option_entries for more details.

See OptionEntry for more documentation of the arguments.

Parameters:

this

the Application

long_name

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

short_name

the short name of an option

flags

flags from OptionFlags

arg

the type of the option, as a OptionArg

description

the description for the option in `--help` output

arg_description

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