traits => ['NoGetopt'],
);
- # captures the options: --help --usage --?
+ # captures the options: --help --usage --? -? -h
has help_flag => (
is => 'ro', isa => 'Bool',
traits => ['Getopt'],
cmd_flag => 'help',
- cmd_aliases => [ qw(usage ?) ],
+ cmd_aliases => [ qw(usage ? h) ],
documentation => 'Prints this usage information.',
);
with 'MooseX::Getopt::GLD';
+ # or
+
+ with 'MooseX::Getopt::GLD' => { getopt_conf => [ 'pass_through', ... ] };
+
has 'out' => (is => 'rw', isa => 'Str', required => 1);
has 'in' => (is => 'rw', isa => 'Str', required => 1);
## on the command line
% perl my_app_script.pl -in file.input -out file.dump
+=head1 OPTIONS
+
+This role is a parameterized role. It accepts one configuration parameter,
+C<getopt_conf>. This parameter is an ArrayRef of strings, which are
+L<Getopt::Long> configuration options (see "Configuring Getopt::Long" in
+L<Getopt::Long>)
+
=cut