Glib::OptionGroup - Online Linux Manual PageSection : 3pm
Updated : 2020-11-08
Source : perl v5.32.0
Note : User Contributed Perl Documentation
NAMEGlib::OptionGroup − group of options for command line option parsing
SYNOPSIS my ($verbose, $source, $filenames) = ('', undef, []);
my $entries = [
{ long_name => 'verbose',
short_name => 'v',
arg_type => 'none',
arg_value => \$verbose,
description => 'be verbose' },
{ long_name => 'source',
short_name => 's',
arg_type => 'string',
arg_value => \$source,
description => 'set the source',
arg_description => 'source' },
[ 'filenames', 'f', 'filename−array', \$filenames ],
];
my $context = Glib::OptionContext−>new ('− urgsify your life');
$context−>add_main_entries ($entries, 'C');
$context−>parse ();
# $verbose, $source, and $filenames are now updated according to the
# command line options given
HIERARCHY Glib::Boxed
+−−−−Glib::OptionGroup
METHODS
optioncontext = Glib::OptionContext−>new ($parameter_string)• $parameter_string (string)
optiongroup = Glib::OptionGroup−>new (key => value, ...)Creates a new option group from the given key-value pairs. The valid keys are name, description, help_description, and entries. The first three specify strings while the last one, entries, specifies an array reference of option entries. Example: my $group = Glib::OptionGroup−>new (
name => 'urgs',
description => 'Urgs Urgs Urgs',
help_description => 'Help with Urgs',
entries => \@entries);
An option entry is a hash reference like this: { long_name => 'verbose',
short_name => 'v',
flags => [qw/reverse hidden in−main/],
arg_type => 'none',
arg_value => \$verbose,
description => 'verbose desc.',
arg_description => 'verbose arg desc.' }
Of those keys only long_name, arg_type, and arg_value are required. So this is a valid option entry too: { long_name => 'package−names',
arg_type => 'string−array',
arg_value => \$package_names }
For convenience, option entries can also be specified as array references containing long_name, short_name, arg_type, and arg_value: [ 'filenames', 'f', 'filename−array', \$filenames ]
If you don't want an option to have a short name, specify undef for it: [ 'filenames', undef, 'filename−array', \$filenames ]
$context−>add_group ($group)• $group (Glib::OptionGroup)
$context−>add_main_entries ($entries, $translation_domain)• $entries (scalar) reference to an array of option entries • $translation_domain (string)
boolean = $context−>get_help_enabled
$context−>set_help_enabled ($help_enabled)• $help_enabled (boolean)
boolean = $context−>get_ignore_unknown_options
$context−>set_ignore_unknown_options ($ignore_unknown)• $ignore_unknown (boolean)
optiongroup = $context−>get_main_group
$context−>set_main_group ($group)• $group (Glib::OptionGroup)
boolean = $context−>parseThis method works directly on @ARGV. May croak with a Glib::Error in $@ on failure.
$group−>set_translate_func ($func, $data=undef)• $func (scalar) • $data (scalar)
$group−>set_translation_domain ($domain)• $domain (string)
ENUMS AND FLAGS
enum Glib::OptionArg• 'none' / 'G_OPTION_ARG_NONE' • 'string' / 'G_OPTION_ARG_STRING' • 'int' / 'G_OPTION_ARG_INT' • 'callback' / 'G_OPTION_ARG_CALLBACK' • 'filename' / 'G_OPTION_ARG_FILENAME' • 'string−array' / 'G_OPTION_ARG_STRING_ARRAY' • 'filename−array' / 'G_OPTION_ARG_FILENAME_ARRAY' • 'double' / 'G_OPTION_ARG_DOUBLE' • 'int64' / 'G_OPTION_ARG_INT64'
flags Glib::OptionFlags• 'hidden' / 'G_OPTION_FLAG_HIDDEN' • 'in−main' / 'G_OPTION_FLAG_IN_MAIN' • 'reverse' / 'G_OPTION_FLAG_REVERSE' • 'no−arg' / 'G_OPTION_FLAG_NO_ARG' • 'filename' / 'G_OPTION_FLAG_FILENAME' • 'optional−arg' / 'G_OPTION_FLAG_OPTIONAL_ARG' • 'noalias' / 'G_OPTION_FLAG_NOALIAS'
SEE ALSOGlib, Glib::Boxed
COPYRIGHTCopyright (C) 2003−2011 by the gtk2−perl team. This software is licensed under the LGPL. See Glib for a full notice. 0
Johanes Gumabo
Data Size : 25,938 byte
man-Glib::OptionGroup.3pmBuild : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 168,567
Visitor ID : :
Visitor IP : 18.226.165.234 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|Glib::OptionGroup.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|Glib::OptionGroup.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|Glib::OptionGroup.3pm|43|br══─}─══|'br══─}─══
) (htmlprn|149|Glib::OptionGroup.3pm|43|'br══─}─══ |'br══─}─══
)