gi-glib-2.0.23: GLib bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.OptionGroup

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 OptionContext.

Synopsis

Exported types

newtype OptionGroup Source #

Memory-managed wrapper type.

Instances

Instances details
Eq OptionGroup Source # 
Instance details

Defined in GI.GLib.Structs.OptionGroup

IsGValue OptionGroup Source #

Convert OptionGroup to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.GLib.Structs.OptionGroup

BoxedObject OptionGroup Source # 
Instance details

Defined in GI.GLib.Structs.OptionGroup

Methods

Overloaded methods

addEntries

optionGroupAddEntries Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

group: a OptionGroup

-> OptionEntry

entries: a Nothing-terminated array of GOptionEntrys

-> m () 

Adds the options specified in entries to group.

Since: 2.6

free

optionGroupFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

group: a OptionGroup

-> m () 

Deprecated: (Since version 2.44)Use optionGroupUnref instead.

Frees a OptionGroup. Note that you must not free groups which have been added to a OptionContext.

Since: 2.6

new

optionGroupNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

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

-> Text

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

-> Text

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

-> Ptr ()

userData: user data that will be passed to the pre- and post-parse hooks, the error hook and to callbacks of OptionArgCallback options, or Nothing

-> Maybe DestroyNotify

destroy: a function that will be called to free userData, or Nothing

-> m OptionGroup

Returns: a newly created option group. It should be added to a OptionContext or freed with optionGroupUnref.

Creates a new OptionGroup.

Since: 2.6

ref

optionGroupRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

group: a OptionGroup

-> m OptionGroup

Returns: a OptionGroup

Increments the reference count of group by one.

Since: 2.44

setTranslateFunc

optionGroupSetTranslateFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

group: a OptionGroup

-> Maybe TranslateFunc

func: the TranslateFunc, or Nothing

-> m () 

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

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

Since: 2.6

setTranslationDomain

optionGroupSetTranslationDomain Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

group: a OptionGroup

-> Text

domain: the domain to use

-> m () 

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

Since: 2.6

unref

optionGroupUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

group: a OptionGroup

-> m () 

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.

Since: 2.44