Add test for strange --version handling
[gitmo/MooseX-Getopt.git] / t / version_with_simpleconfig.pl
CommitLineData
a7474a4d 1package WithOptionsAndSimpleConfig;
2use Moose;
3
4with 'MooseX::Getopt';
5
6has print_version => (
7 traits => [qw(Getopt)],
8 isa => 'Bool',
9 is => 'ro',
10 cmd_flag => 'version',
11 cmd_aliases => 'v',
12);
13
14has configfile => (
15 traits => [qw(NoGetopt)],
16 isa => 'Str',
17 coerce => 1,
18 is => 'ro',
19);
20
21with 'MooseX::SimpleConfig';
22
23sub run {
24 my ($self) = @_;
25
26 if ($self->print_version) {
27 print "SUCCESS\n";
28 exit;
29 }
30}
31
32package main;
33WithOptionsAndSimpleConfig->new_with_options;