From efed09f4b552e5599bde4a3bc4f8948a08519d70 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Jul 2018 13:12:03 +0100 Subject: pieces have names --- lib/Getopt/Dakkar.pm | 2 +- lib/Getopt/Dakkar/Role/Piece.pm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Getopt/Dakkar.pm b/lib/Getopt/Dakkar.pm index b43c24e..f35147b 100644 --- a/lib/Getopt/Dakkar.pm +++ b/lib/Getopt/Dakkar.pm @@ -6,4 +6,4 @@ use Module::Runtime qw(use_module); with 'Getopt::Dakkar::Role::Command'; -1; +has '+name' => ( default => $0 ); diff --git a/lib/Getopt/Dakkar/Role/Piece.pm b/lib/Getopt/Dakkar/Role/Piece.pm index d981095..144f9e7 100644 --- a/lib/Getopt/Dakkar/Role/Piece.pm +++ b/lib/Getopt/Dakkar/Role/Piece.pm @@ -3,6 +3,7 @@ use Getopt::Dakkar::Style qw(role); # VERSION # ABSTRACT: a piece +has name => ( is => 'ro', isa => Str, required => 1 ); has class => ( is => 'ro', isa => ClassName, default => 'Getopt::Dakkar::Stash' ); has object => ( is => 'ro', isa => Object ); has op => ( is => 'ro', isa => Str|CodeRef ); -- cgit v1.2.3