summaryrefslogtreecommitdiff
path: root/lib/Getopt/Dakkar/Role/Piece.pm
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2018-07-13 13:32:45 +0100
committerdakkar <dakkar@thenautilus.net>2018-07-13 13:32:45 +0100
commitc11ab0abb790e519d63c47c37962c31dc032014a (patch)
tree991a8368e29c0abdb0d38197f5deecca1bc9ba3b /lib/Getopt/Dakkar/Role/Piece.pm
parentmake sure we return undef when stuff is not found (diff)
downloadGetopt-Dakkar-c11ab0abb790e519d63c47c37962c31dc032014a.tar.gz
Getopt-Dakkar-c11ab0abb790e519d63c47c37962c31dc032014a.tar.bz2
Getopt-Dakkar-c11ab0abb790e519d63c47c37962c31dc032014a.zip
I'm losing the plot, here
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);