From: Karen Etheridge Date: Sat, 22 Dec 2012 06:57:26 +0000 (-0800) Subject: mention the aliasing feature of NoGetopt as well X-Git-Tag: v0.48~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Getopt.git;a=commitdiff_plain;h=1e592beebf132ad7bd641fc9c441f47eece0400b mention the aliasing feature of NoGetopt as well --- diff --git a/lib/MooseX/Getopt/Meta/Attribute.pm b/lib/MooseX/Getopt/Meta/Attribute.pm index 8bace3b..fd89a3f 100644 --- a/lib/MooseX/Getopt/Meta/Attribute.pm +++ b/lib/MooseX/Getopt/Meta/Attribute.pm @@ -24,7 +24,7 @@ sub register_implementation { 'MooseX::Getopt::Meta::Attribute' } with 'MooseX::Getopt'; has 'data' => ( - metaclass => 'MooseX::Getopt::Meta::Attribute', + metaclass => ['Getopt'], is => 'ro', isa => 'Str', default => 'file.dat', diff --git a/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm b/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm index 934f041..f57aa99 100644 --- a/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm +++ b/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm @@ -36,6 +36,14 @@ that a specific attribute should B be processed by C. All you need to do is specify the C metaclass. - has 'foo' => (metaclass => 'NoGetopt', ... ); + has 'foo' => (metaclass => 'MooseX::Getopt::Meta::Attribute::NoGetopt', ... ); + +=head2 Custom Metaclass alias + +This now takes advantage of the Moose 0.19 feature to support +custom attribute metaclass. This means you can also +use this as the B alias, like so: + + has 'foo' => (metaclass => 'NoGetopt', cmd_flag => 'f'); =cut