diff options
author | J Pipkin <j@dawnrazor.net> | 2012-09-08 14:31:40 -0500 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2012-09-08 14:31:40 -0500 |
commit | 788ae188dc9c8f8de4a20e1fdcc401f5b15b0890 (patch) | |
tree | 16f4eac8c8bef0b5765ee4197aaa99915e19d94c | |
parent | 3bc0af3c6cc7cac45765b981495ee5903f58d7dd (diff) | |
download | sbotools2-788ae188dc9c8f8de4a20e1fdcc401f5b15b0890.tar.xz |
sbosnap converted to Getopt::Long
-rwxr-xr-x | sbosnap | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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; |