diff options
author | J Pipkin <j@dawnrazor.net> | 2012-09-09 11:41:02 -0500 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2012-09-09 11:41:02 -0500 |
commit | 419ebbfb3034a92fdbc36ae0a8bdb6cab76f5f37 (patch) | |
tree | 30b003cb6716a966bc6b4329356339e161952402 | |
parent | df0a60cb51b7951b8a83b21115eafdc3deff8d30 (diff) | |
download | sbotools2-419ebbfb3034a92fdbc36ae0a8bdb6cab76f5f37.tar.xz |
add a help option to sbocheck
-rwxr-xr-x | sbocheck | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -15,10 +15,28 @@ use warnings FATAL => 'all'; use SBO::Lib; use Getopt::Long qw(:config); use Text::Tabulate; +use File::Basename; -my $vers; -GetOptions ('version|v' => \$vers); +my $self = basename ($0); +sub show_usage () { + print <<EOF +Usage: $self + +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; |