Gjsify LogoGjsify Logo

A GOptionGroup struct defines the options in a single group. The struct has only private fields and should not be directly accessed.

All options in a group share the same translation function. Libraries which need to parse commandline options are expected to provide a function for getting a GOptionGroup holding their options, which the application can then add to its #GOptionContext.

record

Hierarchy

  • OptionGroup

Index

Constructors

  • Creates a new #GOptionGroup.

    Parameters

    • name: string

      the name for the option group, this is used to provide help for the options in this group with --help-``name

    • description: string

      a description for this group to be shown in --help. This string is translated using the translation domain or translation function of the group

    • help_description: string

      a description for the --help-``name option. This string is translated using the translation domain or translation function of the group

    • user_data: object

      user data that will be passed to the pre- and post-parse hooks, the error hook and to callbacks of %G_OPTION_ARG_CALLBACK options, or %NULL

    • destroy: GLib.DestroyNotify

      a function that will be called to free user_data, or %NULL

    Returns OptionGroup

Properties

name: string

Methods

  • free(): void
  • Frees a #GOptionGroup. Note that you must not free groups which have been added to a #GOptionContext.

    Returns void

  • Sets the function which is used to translate user-visible strings, for --help output. Different groups can use different #GTranslateFuncs. If func is %NULL, strings are not translated.

    If you are using gettext(), you only need to set the translation domain, see g_option_group_set_translation_domain().

    Parameters

    Returns void

  • set_translation_domain(domain: string): void
  • A convenience function to use gettext() for translating user-visible strings.

    Parameters

    • domain: string

      the domain to use

    Returns void

  • unref(): void
  • Decrements the reference count of group by one. If the reference count drops to 0, the group will be freed. and all memory allocated by the group is released.

    Returns void

  • Creates a new #GOptionGroup.

    Parameters

    • name: string

      the name for the option group, this is used to provide help for the options in this group with --help-``name

    • description: string

      a description for this group to be shown in --help. This string is translated using the translation domain or translation function of the group

    • help_description: string

      a description for the --help-``name option. This string is translated using the translation domain or translation function of the group

    • user_data: object

      user data that will be passed to the pre- and post-parse hooks, the error hook and to callbacks of %G_OPTION_ARG_CALLBACK options, or %NULL

    • destroy: GLib.DestroyNotify

      a function that will be called to free user_data, or %NULL

    Returns OptionGroup

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method