diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-09-21 07:00:32 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-09-21 07:00:32 -0500 |
commit | 698a4c30a34eafda3f4a325cd3cef1f7672bcdec (patch) | |
tree | 6b87bf7afb5ff09cd3c52370187c06065c6b99e6 /sbocheck | |
parent | 494771b27db5e36e9d34513ef3cd52e33257de58 (diff) | |
download | sbotools-698a4c30a34eafda3f4a325cd3cef1f7672bcdec.tar.xz |
sbocheck converted to long options and fixes added from 0.8
Diffstat (limited to 'sbocheck')
-rwxr-xr-x | sbocheck | 28 |
1 files changed, 23 insertions, 5 deletions
@@ -13,15 +13,33 @@ use 5.16.0; use strict; use warnings FATAL => 'all'; use SBO::Lib; -use Getopt::Std; +use Getopt::Long; use Text::Tabulate; +use File::Basename; -my %options; -getopts ('v',\%options); +my $self = basename ($0); -show_version && exit 0 if exists $options{v}; +sub show_usage () { + print <<EOF +Usage: $self -update_tree; +Options: + -h|--help: + this screen. + -v|--version: + version information. + +EOF +} + +my ($help, $vers); + +GetOptions ('help|h' => \$help, 'version|v' => \$vers); + +show_usage && exit 0 if $help; +show_version && exit 0 if $vers; + +update_tree; # retrieve and format list of available updates sub get_update_list () { |