summaryrefslogtreecommitdiff
path: root/lib/Getopt/Dakkar/Role/Piece.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Getopt/Dakkar/Role/Piece.pm')
-rw-r--r--lib/Getopt/Dakkar/Role/Piece.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Getopt/Dakkar/Role/Piece.pm b/lib/Getopt/Dakkar/Role/Piece.pm
index 144f9e7..81c89e7 100644
--- a/lib/Getopt/Dakkar/Role/Piece.pm
+++ b/lib/Getopt/Dakkar/Role/Piece.pm
@@ -4,6 +4,14 @@ use Getopt::Dakkar::Style qw(role);
# ABSTRACT: a piece
has name => ( is => 'ro', isa => Str, required => 1 );
+has aliases => ( is => 'ro', isa => ArrayRef[Str], default => sub { [] } );
+has matching_strings => (
+ is => 'lazy',
+ isa => ArrayRef[Str],
+ init_arg => 'matches',
+);
+sub _build_matching_strings($self) { [ $self->name, $self->aliases->@* ] }
+
has class => ( is => 'ro', isa => ClassName, default => 'Getopt::Dakkar::Stash' );
has object => ( is => 'ro', isa => Object );
has op => ( is => 'ro', isa => Str|CodeRef );
@@ -20,4 +28,4 @@ sub make_stash($self,$argpack) {
}
}
-requires 'parse';
+requires qw(parse match);