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