package Getopt::Dakkar::Role::Piece; use Getopt::Dakkar::Style qw(role); # VERSION # 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->@* ] } requires qw(parse match);