1MooseX::App::Role(3) User Contributed Perl Documentation MooseX::App::Role(3)
2
3
4
6 MooseX::App::Role - Define attributes in a role
7
9 package MyApp::Role::SomeRole;
10
11 use MooseX::App::Role; # Alo loads Moose::Role
12
13 option 'testattr' => (
14 isa => 'rw',
15 cmd_tags => [qw(Important! Nice))],
16 );
17
19 Enables the 'option' and 'parameter' keywords in your roles.
20
21 Alternatively you can also just use attribute traits:
22
23 has 'testattr' => (
24 isa => 'rw',
25 traits => ['AppOption'], # required
26 cmd_type => 'option', # required
27 cmd_tags => [qw(Important! Nice))],
28 );
29
30
31
32perl v5.36.0 2023-01-20 MooseX::App::Role(3)