From e075e3895f52d0d65a2df67297dc51e6b0507090 Mon Sep 17 00:00:00 2001 From: "mahlon@martini.nu" Date: Tue, 6 Sep 2011 23:10:32 +0000 Subject: [PATCH] Add a --version flag. FossilOrigin-Name: e34e03be94f152da1a6929ff71b6a1eb8923b8f5e038fd0f25f80fbb7ae657dc --- shelldap | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/shelldap b/shelldap index dc31733..1932771 100755 --- a/shelldap +++ b/shelldap @@ -177,6 +177,14 @@ Print extra operational info out, and backtrace on fatal error. =back +=over 4 + +=item B + +Display the version number. + +=back + =head1 SHELL COMMANDS =over 4 @@ -1752,7 +1760,7 @@ use strict; use warnings; $0 = 'shelldap'; -my $VERSION = '0.4'; +my $VERSION = '0.5'; use Getopt::Long; use YAML::Syck; @@ -1774,7 +1782,7 @@ Getopt::Long::GetOptions( 'tls_cacert=s', 'tls_cert=s', 'tls_key=s', - 'tls', 'debug', + 'tls', 'debug', 'version', help => sub { Pod::Usage::pod2usage( -verbose => 1, @@ -1783,6 +1791,12 @@ Getopt::Long::GetOptions( } ); +# show version +if ( $conf->{'version'} ) { + print "$VERSION\n"; + exit( 0 ); +} + # defaults $conf->{'confpath'} = "$ENV{'HOME'}/.shelldap.rc"; $conf->{'cacheage'} ||= 300;