aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsbosnap16
1 files changed, 7 insertions, 9 deletions
diff --git a/sbosnap b/sbosnap
index 1d835ab..f2777b8 100755
--- a/sbosnap
+++ b/sbosnap
@@ -46,18 +46,16 @@ GetOptions('help|h' => \$help, 'version|v' => \$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 {
+$ARGV[0] //= '';
+
+if ($ARGV[0] eq 'fetch') {
+ fetch_tree()
+} elsif ($ARGV[0] eq 'update') {
+ update_tree()
+} else {
show_usage();
exit 1;
}
-if ($command eq 'fetch') { fetch_tree() }
-elsif ($command eq 'update') { update_tree() }
-
exit 0;