commit 788ae188dc9c8f8de4a20e1fdcc401f5b15b0890
parent 3bc0af3c6cc7cac45765b981495ee5903f58d7dd
Author: J Pipkin <j@dawnrazor.net>
Date: Sat, 8 Sep 2012 14:31:40 -0500
sbosnap converted to Getopt::Long
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git 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);
@@ -38,11 +38,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' => \$version);
+
+show_usage and exit 0 if $help;
+show_version and exit 0 if $version;
# check for a command and, if found, execute it
my $command;