From c11ab0abb790e519d63c47c37962c31dc032014a Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Jul 2018 13:32:45 +0100 Subject: I'm losing the plot, here --- lib/Getopt/Dakkar/Role/Piece.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/Getopt/Dakkar/Role/Piece.pm') 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); -- cgit v1.2.3