diff options
author | J Pipkin <j@dawnrazor.net> | 2012-09-08 13:32:57 -0500 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2012-09-08 13:32:57 -0500 |
commit | 72ee960934f156d8928c41b4654cd6b56683185d (patch) | |
tree | 18613c13fe1c8c549e94d63f7ba5fb39cbfabab7 | |
parent | 3823e045f53742676b62027aed01d6d30372b528 (diff) | |
download | sbotools2-72ee960934f156d8928c41b4654cd6b56683185d.tar.xz |
sbofind converted to Getopt::Long
-rwxr-xr-x | sbofind | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -14,7 +14,7 @@ use strict; use warnings FATAL => 'all'; use SBO::Lib; use File::Basename; -use Getopt::Std; +use Getopt::Long qw(:config bundling); my $self = basename ($0); @@ -34,14 +34,17 @@ Example: EOF } -my %options; -getopts ('hvir', \%options); +my ($help, $vers, $show_info, $show_readme); -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, + 'info|i' => \$show_info, + 'readme|r' => \$show_readme, +); -my $show_readme = exists $options{r} ? 1 : 0; -my $show_info = exists $options{i} ? 1 : 0; +show_usage and exit 0 if $help; +show_version and exit 0 if $vers; show_usage and exit 1 unless exists $ARGV[0]; my $search = $ARGV[0]; |