1 package MooseX::Getopt::Dashes;
6 around _get_cmd_flags_for_attr => sub {
8 my ( $class, $attr, @rest ) = @_;
10 my ( $flag, @aliases ) = $class->$next($attr, @rest);
12 unless $attr->does('MooseX::Getopt::Meta::Attribute::Trait')
13 && $attr->has_cmd_flag;
15 return ( $flag, @aliases );
26 MooseX::Getopt::Dashes - convert underscores in attribute names to dashes
32 with 'MooseX::Getopt::Dashes';
34 # Will be called as --some-thingy, not --some_thingy
35 has 'some_thingy' => (
41 # Will be called as --another_thingy, not --another-thingy
42 has 'another_thingy' => (
43 traits => [ 'Getopt' ],
44 cmd_flag => 'another_thingy'
50 # use as MooseX::Getopt
54 This is a version of C<MooseX::Getopt> which converts underscores in
55 attribute names to dashes when generating command line flags.
57 You can selectively disable this on a per-attribute basis by supplying
58 a L<cmd_flag|MooseX::Getopt::Meta::Attribute/METHODS> argument with
59 the command flag you'd like for a given attribute. No underscore to
60 dash replacement will be done on the C<cmd_flag>.
72 All complex software has bugs lurking in it, and this module is no
73 exception. If you find a bug please either email me, or add the bug
78 Dagfinn Ilmari MannsE<aring>ker E<lt>ilmari@ilmari.orgE<gt>
80 Stevan Little E<lt>stevan@iinteractive.comE<gt>
82 Yuval Kogman C<< <nuffin@cpan.org> >>
84 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason E<lt>avar@cpan.orgE<gt>
86 =head1 COPYRIGHT AND LICENSE
88 Copyright 2007-2008 by Infinity Interactive, Inc.
90 L<http://www.iinteractive.com>
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.