Add a --version flag.
authorMahlon E. Smith <mahlon@martini.nu>
Tue, 06 Sep 2011 16:10:33 -0700
changeset 37 7a8855e7cfb8
parent 36 2e78218b8045
child 38 12f279ef4f9d
Add a --version flag.
shelldap
--- a/shelldap	Tue Sep 06 16:05:35 2011 -0700
+++ b/shelldap	Tue Sep 06 16:10:33 2011 -0700
@@ -177,6 +177,14 @@
 
 =back
 
+=over 4
+
+=item B<version>
+
+Display the version number.
+
+=back
+
 =head1 SHELL COMMANDS
 
 =over 4
@@ -1752,7 +1760,7 @@
 use warnings;
 
 $0 = 'shelldap';
-my $VERSION = '0.4';
+my $VERSION = '0.5';
 
 use Getopt::Long;
 use YAML::Syck;
@@ -1774,7 +1782,7 @@
 	'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 @@
 	}
 );
 
+# show version
+if ( $conf->{'version'} ) {
+	print "$VERSION\n";
+	exit( 0 );
+}
+
 # defaults
 $conf->{'confpath'} = "$ENV{'HOME'}/.shelldap.rc";
 $conf->{'cacheage'} ||= 300;