aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsbosnap17
1 files changed, 10 insertions, 7 deletions
diff --git a/sbosnap b/sbosnap
index 9072941..2562356 100755
--- a/sbosnap
+++ b/sbosnap
@@ -15,7 +15,7 @@ use strict;
use warnings FATAL => 'all';
use SBO::Lib;
use File::Basename;
-use Getopt::Std;
+use Getopt::Long;
my $sbo_home = $config{SBO_HOME};
my $self = basename ($0);
@@ -25,8 +25,10 @@ sub show_usage () {
Usage: $self [options|command]
Options:
- -h: this screen.
- -v: version information.
+ -h|--help:
+ this screen.
+ -v|--version:
+ version information.
Commands:
fetch: initialize a local copy of the slackbuilds.org tree.
@@ -38,11 +40,12 @@ EOF
show_usage and exit 1 unless exists $ARGV[0];
-my %options;
-getopts ('hv', \%options);
+my ($help, $vers);
-show_usage and exit 0 if exists $options{h};
-show_version and exit 0 if exists $options{v};
+GetOptions ('help|h' => \$help, 'version|v' => \$vers);
+
+show_usage and exit 0 if $help;
+show_version and exit 0 if $vers;
# check for a command and, if found, execute it
my $command;