From 0a035d36fb6a225640d31162e4b348dacfa93f96 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Sat, 16 Apr 2016 17:21:28 +0200 Subject: Remove useless conditions from show_usage/version invocations --- sbosnap | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sbosnap') diff --git a/sbosnap b/sbosnap index e0876a5..1d835ab 100755 --- a/sbosnap +++ b/sbosnap @@ -39,21 +39,22 @@ EOF return 1; } -show_usage() and exit 1 unless exists $ARGV[0]; - my ($help, $vers); GetOptions('help|h' => \$help, 'version|v' => \$vers); -show_usage() and exit 0 if $help; -show_version() and exit 0 if $vers; +if ($help) { show_usage(); exit 0 } +if ($vers) { show_version(); exit 0 } + +if (!@ARGV) { show_usage(); exit 1 } # check for a command and, if found, execute it my $command; if ($ARGV[0] =~ /fetch|update/) { $command = $ARGV[0]; } else { - show_usage() and exit 1; + show_usage(); + exit 1; } if ($command eq 'fetch') { fetch_tree() } -- cgit v1.2.3