diff options
-rwxr-xr-x | sbosnap | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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; |