prefer trait over metaclass as much as possible
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Meta / Attribute / NoGetopt.pm
index 934f041..c665950 100644 (file)
@@ -36,6 +36,25 @@ that a specific attribute should B<not> be processed by
 C<MooseX::Getopt>. All you need to do is specify the C<NoGetopt>
 metaclass.
 
-  has 'foo' => (metaclass => 'NoGetopt', ... );
+  has 'foo' => (metaclass => 'MooseX::Getopt::Meta::Attribute::NoGetopt', ... );
+
+=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 futher modify the attribute by applying
+additional roles.
+
+Therefore, you should first try to do this:
+
+  has 'foo' => (traits => ['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<NoGetopt> alias, like so:
+
+  has 'foo' => (metaclass => 'NoGetopt', cmd_flag => 'f');
 
 =cut