aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 () {