From: Charles McGarvey Date: Thu, 13 Jun 2019 08:54:36 +0000 (-0600) Subject: fix bug making --version, --help flags unusable X-Git-Tag: v0.003~1 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=2119b378bc4d743317cde8aef0b01c00ad159e51;p=chaz%2Fhomebank2ledger fix bug making --version, --help flags unusable --- diff --git a/lib/App/HomeBank2Ledger.pm b/lib/App/HomeBank2Ledger.pm index 2075bd8..e152a7e 100644 --- a/lib/App/HomeBank2Ledger.pm +++ b/lib/App/HomeBank2Ledger.pm @@ -66,6 +66,10 @@ sub main { if ($opts->{manual}) { pod2usage(-exitval => 0, -verbose => 2); } + if (!$opts->{input}) { + print STDERR "Input file is required.\n"; + exit(1); + } my $homebank = File::HomeBank->new(file => $opts->{input}); @@ -400,10 +404,6 @@ sub parse_args { ) or pod2usage(-exitval => 1, -verbose => 99, -sections => [qw(SYNOPSIS OPTIONS)]); $opts{input} = shift @args if !$opts{input}; - if (!$opts{input}) { - print STDERR "Input file is required.\n"; - exit(1); - } return \%opts; }