Next:
Glib::OptionGroup
Previous:
Glib::Object::Subclass
 [Gtk2-Perl - Table of Contents][Gtk2-Perl - Index]

Glib::OptionContext



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)

$context->add_group ($group)

$context->add_main_entries ($entries, $translation_domain)

boolean = $context->get_help_enabled

$context->set_help_enabled ($help_enabled)

boolean = $context->get_ignore_unknown_options

$context->set_ignore_unknown_options ($ignore_unknown)

optiongroup = $context->get_main_group

$context->set_main_group ($group)

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.


[Top] Generated by Marek::Pod::HTML 0.49 on Wed Dec 16 22:57:43 2009