=head1 NAME

Glib::OptionContext

=cut

=for position SYNOPSIS

=head1 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

=cut



=head1 HIERARCHY

  Glib::Boxed
  +----Glib::OptionContext



=cut


=head1 METHODS

=head2 optioncontext = Glib::OptionContext-E<gt>B<new> ($parameter_string)

=over

=item * $parameter_string (string) 

=back

=head2 $context-E<gt>B<add_group> ($group)

=over

=item * $group (Glib::OptionGroup) 

=back

=head2 $context-E<gt>B<add_main_entries> ($entries, $translation_domain)

=over

=item * $entries (scalar) reference to an array of option entries

=item * $translation_domain (string) 

=back



=head2 boolean = $context-E<gt>B<get_help_enabled> 

=head2 $context-E<gt>B<set_help_enabled> ($help_enabled)

=over

=item * $help_enabled (boolean) 

=back

=head2 boolean = $context-E<gt>B<get_ignore_unknown_options> 

=head2 $context-E<gt>B<set_ignore_unknown_options> ($ignore_unknown)

=over

=item * $ignore_unknown (boolean) 

=back

=head2 optiongroup = $context-E<gt>B<get_main_group> 

=head2 $context-E<gt>B<set_main_group> ($group)

=over

=item * $group (Glib::OptionGroup) 

=back

=head2 boolean = $context-E<gt>B<parse> 

This method works directly on I<@ARGV>.

May croak with a L<Glib::Error> in $@ on failure.



=cut


=head1 SEE ALSO

L<Glib>, L<Glib::Boxed>


=cut


=head1 COPYRIGHT

Copyright (C) 2003-2009 by the gtk2-perl team.

This software is licensed under the LGPL.  See L<Glib> for a full notice.



=cut

