Glib::OptionContext(3) User Contributed Perl Documentation Glib::OptionContext(3)
NAME
Glib::OptionContext
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::OptionContext
METHODS
optioncontext = Glib::OptionContext->new ($parameter_string)
o $parameter_string (string)
$context->add_group ($group)
o $group (Glib::OptionGroup)
$context->add_main_entries ($entries, $translation_domain)
o $entries (scalar) reference to an array of option entries
o $translation_domain (string)
boolean = $context->get_help_enabled
$context->set_help_enabled ($help_enabled)
o $help_enabled (boolean)
boolean = $context->get_ignore_unknown_options
$context->set_ignore_unknown_options ($ignore_unknown)
o $ignore_unknown (boolean)
optiongroup = $context->get_main_group
$context->set_main_group ($group)
o $group (Glib::OptionGroup)
boolean = $context->parse
This method works directly on @ARGV.
May croak with a Glib::Error in $@ on failure.
SEE ALSO
Glib, Glib::Boxed
COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team.
This software is licensed under the LGPL. See Glib for a full notice.
perl v5.12.1 2010-07-05 Glib::OptionContext(3)