aboutsummaryrefslogtreecommitdiff
path: root/sbosnap
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-09-21 07:01:29 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-09-21 07:01:29 -0500
commitd79f3ffe2ebaaa33f2c2324c3a2dba8aedc0efcc (patch)
tree0e05bb603bc45e2b55fa2669a610f77ccc5fbb98 /sbosnap
parent32d62c3cfd5e43ab6c5a90382b1dabedd09921c3 (diff)
downloadsbotools2-d79f3ffe2ebaaa33f2c2324c3a2dba8aedc0efcc.tar.xz
sbosnap converted to long options and fixes added from 0.8
Diffstat (limited to 'sbosnap')
-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;