/usr/lib/perl5/Glib/OptionGroup.pod is in libglib-perl 3:1.304-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | =head1 NAME
Glib::OptionGroup - group of options for command line option parsing
=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::OptionGroup
=cut
=for object Glib::OptionGroup group of options for command line option parsing
=cut
=head1 METHODS
=head2 optioncontext = Glib::OptionContext-E<gt>B<new> ($parameter_string)
=over
=item * $parameter_string (string)
=back
=head2 optiongroup = Glib::OptionGroup->B<new> (key => value, ...)
=over
=back
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 ]
=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.
=head2 $group-E<gt>B<set_translate_func> ($func, $data=undef)
=over
=item * $func (scalar)
=item * $data (scalar)
=back
=head2 $group-E<gt>B<set_translation_domain> ($domain)
=over
=item * $domain (string)
=back
=cut
=head1 ENUMS AND FLAGS
=head2 enum Glib::OptionArg
=over
=item * 'none' / 'G_OPTION_ARG_NONE'
=item * 'string' / 'G_OPTION_ARG_STRING'
=item * 'int' / 'G_OPTION_ARG_INT'
=item * 'callback' / 'G_OPTION_ARG_CALLBACK'
=item * 'filename' / 'G_OPTION_ARG_FILENAME'
=item * 'string-array' / 'G_OPTION_ARG_STRING_ARRAY'
=item * 'filename-array' / 'G_OPTION_ARG_FILENAME_ARRAY'
=item * 'double' / 'G_OPTION_ARG_DOUBLE'
=item * 'int64' / 'G_OPTION_ARG_INT64'
=back
=head2 flags Glib::OptionFlags
=over
=item * 'hidden' / 'G_OPTION_FLAG_HIDDEN'
=item * 'in-main' / 'G_OPTION_FLAG_IN_MAIN'
=item * 'reverse' / 'G_OPTION_FLAG_REVERSE'
=item * 'no-arg' / 'G_OPTION_FLAG_NO_ARG'
=item * 'filename' / 'G_OPTION_FLAG_FILENAME'
=item * 'optional-arg' / 'G_OPTION_FLAG_OPTIONAL_ARG'
=item * 'noalias' / 'G_OPTION_FLAG_NOALIAS'
=back
=cut
=head1 SEE ALSO
L<Glib>, L<Glib::Boxed>
=cut
=head1 COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See L<Glib> for a full notice.
=cut
|