aboutsummaryrefslogtreecommitdiff
path: root/sbocheck
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-09-21 07:00:32 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-09-21 07:00:32 -0500
commit698a4c30a34eafda3f4a325cd3cef1f7672bcdec (patch)
tree6b87bf7afb5ff09cd3c52370187c06065c6b99e6 /sbocheck
parent494771b27db5e36e9d34513ef3cd52e33257de58 (diff)
downloadsbotools-698a4c30a34eafda3f4a325cd3cef1f7672bcdec.tar.xz
sbocheck converted to long options and fixes added from 0.8
Diffstat (limited to 'sbocheck')
-rwxr-xr-xsbocheck28
1 files changed, 23 insertions, 5 deletions
diff --git a/sbocheck b/sbocheck
index aa257c9..ccbbe24 100755
--- a/sbocheck
+++ b/sbocheck
@@ -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 () {