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 %protolong;
|
||||||
my %catlong;
|
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
|
# get the long name version, return the man page string
|
||||||
sub manpageify {
|
sub manpageify {
|
||||||
my ($k)=@_;
|
my ($k)=@_;
|
||||||
@ -365,6 +378,8 @@ sub header {
|
|||||||
open(F, "<:crlf", "$f");
|
open(F, "<:crlf", "$f");
|
||||||
my @d;
|
my @d;
|
||||||
while(<F>) {
|
while(<F>) {
|
||||||
|
s/%DATE/$date/g;
|
||||||
|
s/%VERSION/$version/g;
|
||||||
push @d, $_;
|
push @d, $_;
|
||||||
}
|
}
|
||||||
close(F);
|
close(F);
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
|
.\" 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
|
.SH NAME
|
||||||
curl \- transfer a URL
|
curl \- transfer a URL
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user