shelldap
changeset 37 7a8855e7cfb8
parent 36 2e78218b8045
child 38 12f279ef4f9d
equal deleted inserted replaced
36:2e78218b8045 37:7a8855e7cfb8
   172 =over 4
   172 =over 4
   173 
   173 
   174 =item B<debug>
   174 =item B<debug>
   175 
   175 
   176 Print extra operational info out, and backtrace on fatal error.
   176 Print extra operational info out, and backtrace on fatal error.
       
   177 
       
   178 =back
       
   179 
       
   180 =over 4
       
   181 
       
   182 =item B<version>
       
   183 
       
   184 Display the version number.
   177 
   185 
   178 =back
   186 =back
   179 
   187 
   180 =head1 SHELL COMMANDS
   188 =head1 SHELL COMMANDS
   181 
   189 
  1750 package main;
  1758 package main;
  1751 use strict;
  1759 use strict;
  1752 use warnings;
  1760 use warnings;
  1753 
  1761 
  1754 $0 = 'shelldap';
  1762 $0 = 'shelldap';
  1755 my $VERSION = '0.4';
  1763 my $VERSION = '0.5';
  1756 
  1764 
  1757 use Getopt::Long;
  1765 use Getopt::Long;
  1758 use YAML::Syck;
  1766 use YAML::Syck;
  1759 use Pod::Usage;
  1767 use Pod::Usage;
  1760 eval 'use Term::ReadLine::Gnu';
  1768 eval 'use Term::ReadLine::Gnu';
  1772 	'cacheage=i',
  1780 	'cacheage=i',
  1773 	'timeout=i',
  1781 	'timeout=i',
  1774 	'tls_cacert=s',
  1782 	'tls_cacert=s',
  1775 	'tls_cert=s',
  1783 	'tls_cert=s',
  1776 	'tls_key=s',
  1784 	'tls_key=s',
  1777 	'tls', 'debug',
  1785 	'tls', 'debug', 'version',
  1778 	 help => sub {
  1786 	 help => sub {
  1779 		Pod::Usage::pod2usage(
  1787 		Pod::Usage::pod2usage(
  1780 			-verbose => 1,
  1788 			-verbose => 1,
  1781 			-message => "\n$0 command line flags\n" . '-' x 65
  1789 			-message => "\n$0 command line flags\n" . '-' x 65
  1782 		);
  1790 		);
  1783 	}
  1791 	}
  1784 );
  1792 );
       
  1793 
       
  1794 # show version
       
  1795 if ( $conf->{'version'} ) {
       
  1796 	print "$VERSION\n";
       
  1797 	exit( 0 );
       
  1798 }
  1785 
  1799 
  1786 # defaults
  1800 # defaults
  1787 $conf->{'confpath'} = "$ENV{'HOME'}/.shelldap.rc";
  1801 $conf->{'confpath'} = "$ENV{'HOME'}/.shelldap.rc";
  1788 $conf->{'cacheage'} ||= 300;
  1802 $conf->{'cacheage'} ||= 300;
  1789 $conf->{'timeout'}  ||= 10;
  1803 $conf->{'timeout'}  ||= 10;