gi-glib-2.0.17: GLib bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.OptionEntry

Contents

Description

A GOptionEntry struct defines a single option. To have an effect, they must be added to a OptionGroup with optionContextAddMainEntries or optionGroupAddEntries.

Synopsis

Exported types

newZeroOptionEntry :: MonadIO m => m OptionEntry Source #

Construct a OptionEntry struct initialized to zero.

Properties

arg

The type of the option, as a OptionArg

getOptionEntryArg :: MonadIO m => OptionEntry -> m OptionArg Source #

Get the value of the “arg” field. When overloading is enabled, this is equivalent to

get optionEntry #arg

setOptionEntryArg :: MonadIO m => OptionEntry -> OptionArg -> m () Source #

Set the value of the “arg” field. When overloading is enabled, this is equivalent to

set optionEntry [ #arg := value ]

argData

If the arg type is OptionArgCallback, then argData must point to a OptionArgFunc callback function, which will be called to handle the extra argument. Otherwise, argData is a pointer to a location to store the value, the required type of the location depends on the arg type: - OptionArgNone: gboolean - OptionArgString: gchar* - OptionArgInt: gint - OptionArgFilename: gchar* - OptionArgStringArray: gchar** - OptionArgFilenameArray: gchar** - OptionArgDouble: gdouble If arg type is OptionArgString or OptionArgFilename, the location will contain a newly allocated string if the option was given. That string needs to be freed by the callee using free. Likewise if arg type is OptionArgStringArray or OptionArgFilenameArray, the data should be freed using strfreev.

clearOptionEntryArgData :: MonadIO m => OptionEntry -> m () Source #

Set the value of the “arg_data” field to Nothing. When overloading is enabled, this is equivalent to

clear #argData

getOptionEntryArgData :: MonadIO m => OptionEntry -> m (Ptr ()) Source #

Get the value of the “arg_data” field. When overloading is enabled, this is equivalent to

get optionEntry #argData

setOptionEntryArgData :: MonadIO m => OptionEntry -> Ptr () -> m () Source #

Set the value of the “arg_data” field. When overloading is enabled, this is equivalent to

set optionEntry [ #argData := value ]

argDescription

The placeholder to use for the extra argument parsed by the option in --help output. The argDescription is translated using the translateFunc of the group, see optionGroupSetTranslationDomain.

clearOptionEntryArgDescription :: MonadIO m => OptionEntry -> m () Source #

Set the value of the “arg_description” field to Nothing. When overloading is enabled, this is equivalent to

clear #argDescription

getOptionEntryArgDescription :: MonadIO m => OptionEntry -> m (Maybe Text) Source #

Get the value of the “arg_description” field. When overloading is enabled, this is equivalent to

get optionEntry #argDescription

setOptionEntryArgDescription :: MonadIO m => OptionEntry -> CString -> m () Source #

Set the value of the “arg_description” field. When overloading is enabled, this is equivalent to

set optionEntry [ #argDescription := value ]

description

the description for the option in --help output. The description is translated using the translateFunc of the group, see optionGroupSetTranslationDomain.

clearOptionEntryDescription :: MonadIO m => OptionEntry -> m () Source #

Set the value of the “description” field to Nothing. When overloading is enabled, this is equivalent to

clear #description

getOptionEntryDescription :: MonadIO m => OptionEntry -> m (Maybe Text) Source #

Get the value of the “description” field. When overloading is enabled, this is equivalent to

get optionEntry #description

setOptionEntryDescription :: MonadIO m => OptionEntry -> CString -> m () Source #

Set the value of the “description” field. When overloading is enabled, this is equivalent to

set optionEntry [ #description := value ]

flags

Flags from OptionFlags

getOptionEntryFlags :: MonadIO m => OptionEntry -> m Int32 Source #

Get the value of the “flags” field. When overloading is enabled, this is equivalent to

get optionEntry #flags

setOptionEntryFlags :: MonadIO m => OptionEntry -> Int32 -> m () Source #

Set the value of the “flags” field. When overloading is enabled, this is equivalent to

set optionEntry [ #flags := value ]

longName

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.

clearOptionEntryLongName :: MonadIO m => OptionEntry -> m () Source #

Set the value of the “long_name” field to Nothing. When overloading is enabled, this is equivalent to

clear #longName

getOptionEntryLongName :: MonadIO m => OptionEntry -> m (Maybe Text) Source #

Get the value of the “long_name” field. When overloading is enabled, this is equivalent to

get optionEntry #longName

setOptionEntryLongName :: MonadIO m => OptionEntry -> CString -> m () Source #

Set the value of the “long_name” field. When overloading is enabled, this is equivalent to

set optionEntry [ #longName := value ]

shortName

If an option has a short name, it can be specified -short_name in a commandline. shortName must be a printable ASCII character different from '-', or zero if the option has no short name.

getOptionEntryShortName :: MonadIO m => OptionEntry -> m Int8 Source #

Get the value of the “short_name” field. When overloading is enabled, this is equivalent to

get optionEntry #shortName

setOptionEntryShortName :: MonadIO m => OptionEntry -> Int8 -> m () Source #

Set the value of the “short_name” field. When overloading is enabled, this is equivalent to

set optionEntry [ #shortName := value ]