OptionEntry#
- class OptionEntry(*args, **kwargs)#
A GOptionEntry struct defines a single option. To have an effect, they
must be added to a OptionGroup
with add_main_entries()
or add_entries()
.
Fields#
- class OptionEntry
-
- arg_data#
If the
arg
type isCALLBACK
, thenarg_data
must point to aGOptionArgFunc
callback function, which will be called to handle the extra argument. Otherwise,arg_data
is a pointer to a location to store the value, the required type of the location depends on thearg
type:If
arg
type isSTRING
orFILENAME
, the location will contain a newly allocated string if the option was given. That string needs to be freed by the callee usingfree()
. Likewise ifarg
type isSTRING_ARRAY
orFILENAME_ARRAY
, the data should be freed usingstrfreev()
.
- arg_description#
The placeholder to use for the extra argument parsed by the option in
--help
output. Thearg_description
is translated using thetranslate_func
of the group, seeset_translation_domain()
.
- description#
The description for the option in
--help
output. Thedescription
is translated using thetranslate_func
of the group, seeset_translation_domain()
.
- flags#
Flags from
GOptionFlags
- long_name#
The long name of an option can be used to specify it in a commandline as
--long_name
. Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also possible to specify the option as--groupname-long_name
.
- short_name#
If an option has a short name, it can be specified
-short_name
in a commandline.short_name
must be a printable ASCII character different from ‘-’, or zero if the option has no short name.