Struct
GLibOptionEntry
Description [src]
struct GOptionEntry {
  const gchar* long_name;
  gchar short_name;
  gint flags;
  GOptionArg arg;
  gpointer arg_data;
  const gchar* description;
  const gchar* arg_description;
}
- 
G_OPTION_ARG_NONE: %gboolean- G_OPTION_ARG_STRING: %gchar*
- G_OPTION_ARG_INT: %gint
- G_OPTION_ARG_FILENAME: %gchar*
- G_OPTION_ARG_STRING_ARRAY: %gchar**
- G_OPTION_ARG_FILENAME_ARRAY: %gchar**
- G_OPTION_ARG_DOUBLE: %gdouble
 If argtype isG_OPTION_ARG_STRINGorG_OPTION_ARG_FILENAME, the location will contain a newly allocated string if the option was given. That string needs to be freed by the callee using g_free(). Likewise ifargtype isG_OPTION_ARG_STRING_ARRAYorG_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev(). A GOptionEntry struct defines a single option. To have an effect, they must be added to aGOptionGroupwithg_option_context_add_main_entries()or g_option_group_add_entries().
Structure members
- long_name:- const gchar*
- 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:- gchar
- If an option has a short name, it can be specified - -short_namein a commandline.- short_namemust be a printable ASCII character different from ‘-‘, or zero if the option has no short name.
- flags:- gint
- Flags from - GOptionFlags.
- arg:- GOptionArg
- The type of the option, as a - GOptionArg.
- arg_data:- gpointer
- If the - argtype is- G_OPTION_ARG_CALLBACK, then- arg_datamust point to a- GOptionArgFunccallback function, which will be called to handle the extra argument. Otherwise,- arg_datais a pointer to a location to store the value, the required type of the location depends on the- argtype:.
- description:- const gchar*
- The description for the option in - --helpoutput. The- descriptionis translated using the- translate_funcof the group, see g_option_group_set_translation_domain().
- arg_description:- const gchar*
- The placeholder to use for the extra argument parsed by the option in - --helpoutput. The- arg_descriptionis translated using the- translate_funcof the group, see g_option_group_set_translation_domain().