Add a --version flag.
FossilOrigin-Name: e34e03be94f152da1a6929ff71b6a1eb8923b8f5e038fd0f25f80fbb7ae657dc
This commit is contained in:
parent
270d66ab99
commit
e075e3895f
1 changed files with 16 additions and 2 deletions
18
shelldap
18
shelldap
|
|
@ -177,6 +177,14 @@ Print extra operational info out, and backtrace on fatal error.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
=over 4
|
||||||
|
|
||||||
|
=item B<version>
|
||||||
|
|
||||||
|
Display the version number.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=head1 SHELL COMMANDS
|
=head1 SHELL COMMANDS
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
|
|
@ -1752,7 +1760,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
$0 = 'shelldap';
|
$0 = 'shelldap';
|
||||||
my $VERSION = '0.4';
|
my $VERSION = '0.5';
|
||||||
|
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use YAML::Syck;
|
use YAML::Syck;
|
||||||
|
|
@ -1774,7 +1782,7 @@ Getopt::Long::GetOptions(
|
||||||
'tls_cacert=s',
|
'tls_cacert=s',
|
||||||
'tls_cert=s',
|
'tls_cert=s',
|
||||||
'tls_key=s',
|
'tls_key=s',
|
||||||
'tls', 'debug',
|
'tls', 'debug', 'version',
|
||||||
help => sub {
|
help => sub {
|
||||||
Pod::Usage::pod2usage(
|
Pod::Usage::pod2usage(
|
||||||
-verbose => 1,
|
-verbose => 1,
|
||||||
|
|
@ -1783,6 +1791,12 @@ Getopt::Long::GetOptions(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# show version
|
||||||
|
if ( $conf->{'version'} ) {
|
||||||
|
print "$VERSION\n";
|
||||||
|
exit( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
$conf->{'confpath'} = "$ENV{'HOME'}/.shelldap.rc";
|
$conf->{'confpath'} = "$ENV{'HOME'}/.shelldap.rc";
|
||||||
$conf->{'cacheage'} ||= 300;
|
$conf->{'cacheage'} ||= 300;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue