mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
gen.pl: insert the current date and version in generated man page
Reported-by: Gisle Vanem Ref: #7780 Closes #7782
This commit is contained in:
parent
1ddfa8e480
commit
15910dfd14
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user