aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuenter Knauf <lists@gknw.net>2013-04-04 00:21:10 +0200
committerGuenter Knauf <lists@gknw.net>2013-04-04 00:21:10 +0200
commitc3fa3aaf2c6eec347e9a45aa58a0503894161730 (patch)
tree3b7f46ab1f05c37674dff52cc2542078b789d4bc /lib
parent8efd74de4604ba1114fa191b393f46c7395c8858 (diff)
Added support for --help and --version options.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mk-ca-bundle.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl
index 002723826..230ba4df9 100755
--- a/lib/mk-ca-bundle.pl
+++ b/lib/mk-ca-bundle.pl
@@ -44,6 +44,7 @@ my $version = '1.18';
$opt_w = 76; # default base64 encoded lines length
+$Getopt::Std::STANDARD_HELP_VERSION = 1;
getopts('bfhilnqtuvw:');
if ($opt_i) {
@@ -59,7 +60,7 @@ if ($opt_i) {
}
$0 =~ s@.*(/|\\)@@;
-if ($opt_h) {
+sub HELP_MESSAGE() {
print "Usage:\t${0} [-b] [-f] [-i] [-l] [-n] [-q] [-t] [-u] [-v] [-w<l>] [<outputfile>]\n";
print "\t-b\tbackup an existing version of ca-bundle.crt\n";
print "\t-f\tforce rebuild even if certdata.txt is current\n";
@@ -74,6 +75,12 @@ if ($opt_h) {
exit;
}
+sub VERSION_MESSAGE() {
+ print "${0} version ${version} running on Perl ${]} on ${^O}\n";
+}
+
+HELP_MESSAGE() if ($opt_h);
+
my $crt = $ARGV[0] || 'ca-bundle.crt';
(my $txt = $url) =~ s@(.*/|\?.*)@@g;