Add a --version flag.

FossilOrigin-Name: e34e03be94f152da1a6929ff71b6a1eb8923b8f5e038fd0f25f80fbb7ae657dc
This commit is contained in:
Mahlon E. Smith 2011-09-06 23:10:32 +00:00
parent 270d66ab99
commit e075e3895f

View file

@ -177,6 +177,14 @@ Print extra operational info out, and backtrace on fatal error.
=back
=over 4
=item B<version>
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;