spelling (RT#87780)
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Meta / Attribute.pm
index 8bace3b..fe53a14 100644 (file)
@@ -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',
@@ -52,6 +52,17 @@ which L<MooseX::Getopt> will create for you.
 This is certainly not the prettiest way to go about this, but for
 now it works for those who might need such a feature.
 
+=head2 Use 'traits' instead of 'metaclass'
+
+You should rarely need to explicitly set the attribute metaclass. It is much
+preferred to simply provide a trait (a role applied to the attribute
+metaclass), which allows other code to further modify the attribute by applying
+additional roles.
+
+Therefore, you should first try to do this:
+
+  has 'foo' => (traits => ['Getopt'], cmd_flag => 'f');
+
 =head2 Custom Metaclass alias
 
 This now takes advantage of the Moose 0.19 feature to support