Commit | Line | Data |
adbe3e57 |
1 | package MooseX::Getopt::Meta::Attribute::Trait::NoGetopt; |
669588e2 |
2 | # ABSTRACT: Optional meta attribute trait for ignoring params |
adbe3e57 |
3 | |
669588e2 |
4 | use Moose::Role; |
adbe3e57 |
5 | no Moose::Role; |
6 | |
7 | # register this as a metaclass alias ... |
8 | package # stop confusing PAUSE |
9 | Moose::Meta::Attribute::Custom::Trait::NoGetopt; |
10 | sub register_implementation { 'MooseX::Getopt::Meta::Attribute::Trait::NoGetopt' } |
11 | |
12 | 1; |
13 | |
adbe3e57 |
14 | =head1 SYNOPSIS |
15 | |
16 | package App; |
17 | use Moose; |
669588e2 |
18 | |
adbe3e57 |
19 | with 'MooseX::Getopt'; |
669588e2 |
20 | |
adbe3e57 |
21 | has 'data' => ( |
669588e2 |
22 | traits => [ 'NoGetopt' ], # do not attempt to capture this param |
adbe3e57 |
23 | is => 'ro', |
24 | isa => 'Str', |
25 | default => 'file.dat', |
26 | ); |
27 | |
28 | =head1 DESCRIPTION |
29 | |
669588e2 |
30 | This is a custom attribute metaclass trait which can be used to |
31 | specify that a specific attribute should B<not> be processed by |
32 | C<MooseX::Getopt>. All you need to do is specify the C<NoGetopt> |
adbe3e57 |
33 | metaclass trait. |
34 | |
35 | has 'foo' => (traits => [ 'NoGetopt', ... ], ... ); |
36 | |
adbe3e57 |
37 | =cut |