<GOptionGroup>

<GOptionGroup>

Description

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.

Functions

free

(define-values () (option-group:free self))

Frees a GOptionGroup. Note that you must not free groups which have been added to a GOptionContext.

Parameters

group

a GOptionGroup

Passed as self

ref

(define-values (%return) (option-group:ref self))

Increments the reference count of group by one.

Parameters

group

a GOptionGroup

Passed as self

set-translate-func

(define-values
  ()
  (option-group:set-translate-func self func data destroy-notify))

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

group

a GOptionGroup

Passed as self

func

the GTranslateFunc, or NULL

Passed as func

data

user data to pass to func, or NULL

Passed as data

destroy_notify

a function which gets called to free data, or NULL

Passed as destroy-notify

set-translation-domain

(define-values () (option-group:set-translation-domain self domain))

A convenience function to use gettext() for translating user-visible strings.

Parameters

group

a GOptionGroup

Passed as self

domain

the domain to use

Passed as domain

unref

(define-values () (option-group:unref self))

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.

Parameters

group

a GOptionGroup

Passed as self

option-group:new

(define-values
  (%return)
  (option-group:new name description help-description user-data destroy))

Undocumented

Parameters

name

Passed as name

description

Passed as description

help_description

Passed as help-description

user_data

Passed as user-data

destroy

Passed as destroy