From 2119b378bc4d743317cde8aef0b01c00ad159e51 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Thu, 13 Jun 2019 02:54:36 -0600 Subject: [PATCH] fix bug making --version, --help flags unusable --- lib/App/HomeBank2Ledger.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.43.0