From d79f3ffe2ebaaa33f2c2324c3a2dba8aedc0efcc Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Fri, 21 Sep 2012 07:01:29 -0500 Subject: sbosnap converted to long options and fixes added from 0.8 --- sbosnap | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'sbosnap') 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; -- cgit v1.2.3