X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Getopt.git;a=blobdiff_plain;f=t%2Fversion_with_options.pl;fp=t%2Fversion_with_options.pl;h=d3c7916c784a61839074975e4f0bea4d05d982ff;hp=0000000000000000000000000000000000000000;hb=a7474a4d90cfad550ba39acfc73d6fb972441de7;hpb=50b3ccff5bbcdc77495d6be259b6239527e7f08a diff --git a/t/version_with_options.pl b/t/version_with_options.pl new file mode 100644 index 0000000..d3c7916 --- /dev/null +++ b/t/version_with_options.pl @@ -0,0 +1,24 @@ +package WithOptions; +use Moose; + +with 'MooseX::Getopt'; + +has print_version => ( + traits => [qw(Getopt)], + isa => 'Bool', + is => 'ro', + cmd_flag => 'version', + cmd_aliases => 'v', +); + +sub run { + my ($self) = @_; + + if ($self->print_version) { + print "SUCCESS\n"; + exit; + } +} + +package main; +WithOptions->new_with_options;