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 --- sboupgrade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sboupgrade') diff --git a/sboupgrade b/sboupgrade index e077511..c28819c 100755 --- a/sboupgrade +++ b/sboupgrade @@ -70,8 +70,8 @@ GetOptions( 'all' => \$all, ); -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 } my $updates; if ($all) { @@ -79,9 +79,10 @@ if ($all) { print "Checking for updated SlackBuilds...\n"; $updates = get_available_updates(); push @ARGV, map { $_->{name} } @$updates; + if (!@ARGV) { print "Nothing to update.\n"; exit 0 } } -show_usage() and exit 1 unless exists $ARGV[0]; +if (!@ARGV) { show_usage(); exit 1 } $noclean = $noclean eq 'TRUE' ? 1 : 0; $distclean = $distclean eq 'TRUE' ? 1 : 0; -- cgit v1.2.3