summaryrefslogtreecommitdiff
path: root/docs/cmdline-opts
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-09-27 16:47:04 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-09-27 22:35:48 +0200
commit15910dfd143dda791a7a3e7d515fa54c7183637a (patch)
treeba281be8a90b3368e46abe68938e9b1aba35153c /docs/cmdline-opts
parent1ddfa8e4809f4364ea7323026136ce8d0b0c6cff (diff)
downloadcurl-15910dfd143dda791a7a3e7d515fa54c7183637a.tar.gz
gen.pl: insert the current date and version in generated man page
Reported-by: Gisle Vanem Ref: #7780 Closes #7782
Diffstat (limited to 'docs/cmdline-opts')
-rwxr-xr-xdocs/cmdline-opts/gen.pl15
-rw-r--r--docs/cmdline-opts/page-header2
2 files changed, 16 insertions, 1 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index c058987d4..d63aed168 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -45,6 +45,19 @@ my %redirlong;
my %protolong;
my %catlong;
+use POSIX qw(strftime);
+my $date = strftime "%b %e %Y", localtime;
+my $version = "unknown";
+
+open(INC, "<../../include/curl/curlver.h");
+while(<INC>) {
+ if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) {
+ $version = $1;
+ last;
+ }
+}
+close(INC);
+
# get the long name version, return the man page string
sub manpageify {
my ($k)=@_;
@@ -365,6 +378,8 @@ sub header {
open(F, "<:crlf", "$f");
my @d;
while(<F>) {
+ s/%DATE/$date/g;
+ s/%VERSION/$version/g;
push @d, $_;
}
close(F);
diff --git a/docs/cmdline-opts/page-header b/docs/cmdline-opts/page-header
index 65b503fbb..2a1a7dac9 100644
--- a/docs/cmdline-opts/page-header
+++ b/docs/cmdline-opts/page-header
@@ -22,7 +22,7 @@
.\"
.\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
.\"
-.TH curl 1 "16 Dec 2016" "Curl 7.52.0" "Curl Manual"
+.TH curl 1 "%DATE" "curl %VERSION" "curl Manual"
.SH NAME
curl \- transfer a URL
.SH SYNOPSIS