| Next: Glib::OptionGroup | Previous: Glib::Object::Subclass | [Gtk2-Perl - Table of Contents] | [Gtk2-Perl - Index] |
Glib::OptionContext
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
Glib::Boxed +----Glib::OptionContext
This method works directly on @ARGV.
May croak with a Glib::Error in $@ on failure.
Copyright (C) 2003-2009 by the gtk2-perl team.
This software is licensed under the LGPL. See Glib for a full notice.