MooseX::Getopt::Meta::Attribute::Trait(3pm)

MooseX::Getopt::Meta::Attribute::Trait3pm

Optional meta attribute trait for custom option names

Usage

  package App;
  use Moose;
  with 'MooseX::Getopt';
  has 'data' => (
      traits    => [ 'Getopt' ],
      is        => 'ro',
      isa       => 'Str',
      default   => 'file.dat',
      # tells MooseX::Getopt to use --somedata as the
      # command line flag instead of the normal
      # autogenerated one (--data)
      cmd_flag  => 'somedata',
      # tells MooseX::Getopt to also allow --moosedata,
      # -m, and -d as aliases for this same option on
      # the commandline.
      cmd_aliases => [qw/ moosedata m d /],
      # Or, you can use a plain scalar for a single alias:
      cmd_aliases => 'm',
  );

Version

version 0.78

Overview

This is a custom attribute metaclass trait which can be used to specify a the specific command line flag to use instead of the default one which MooseX::Getopt will create for you.

Methods

cmd_flag

Changes the command-line flag to be this value, instead of the default, which is the same as the attribute name.

cmd_aliases

Adds more aliases for this command-line flag, useful for short options and such.

has_cmd_flag

has_cmd_aliases

Support

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Getopt> (or [email protected] <mailto:[email protected]>).

There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/moose.html>.

There is also an irc channel available for users of this distribution, at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>.

Releases

9 releases since Debian 5.0 (Lenny); the text changed 7 times.

  1. 5.0
  2. 6.0
  3. 7
  4. 8
  5. 9
  6. 10–11
  7. 12
  8. 13

Author

Stevan Little <[email protected]>

From libmoosex-getopt-perl 0.78-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.