diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-09-28 10:30:59 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-09-28 16:19:59 +0200 |
commit | ebf18468c0fb2d74c2c4a2a4a5a6dedd0cf8aea6 (patch) | |
tree | 7da9643531ad235bc66af2986b6e71cdb5dd0c67 /docs/cmdline-opts/gen.pl | |
parent | 6f19f68e9308cf85860ccb414273ccf83ee43598 (diff) | |
download | curl-ebf18468c0fb2d74c2c4a2a4a5a6dedd0cf8aea6.tar.gz |
curl.1: remove mentions of really old version changes
To make the man page more readable, this change removes all references
to changes in support/versions etc that happened before 7.30.0 from the
curl.1 output file. 7.30.0 was released on Apr 12 2013. This particular
limit is a bit arbitrary but was fairly easy to grep for.
It is handled like this: the 'Added' keyword is only used in output if
it refers to 7.30.0 or later. All occurances of "(Added in $VERSION)" in
description will be stripped out if the mentioned $VERSION is from
before 7.30.0. It is therefore important that the "Added in..."
references are always written exactly like that - and on a single line,
not split over two.
This change removes about 80 version number references from curl.1, down
to 138 from 218.
Closes #7786
Diffstat (limited to 'docs/cmdline-opts/gen.pl')
-rwxr-xr-x | docs/cmdline-opts/gen.pl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl index d63aed168..1e9f84696 100755 --- a/docs/cmdline-opts/gen.pl +++ b/docs/cmdline-opts/gen.pl @@ -76,6 +76,12 @@ sub manpageify { sub printdesc { my @desc = @_; for my $d (@desc) { + if($d =~ /\(Added in ([0-9.]+)\)/i) { + my $ver = $1; + if(too_old($ver)) { + $d =~ s/ *\(Added in $ver\)//gi; + } + } if($d !~ /^.\\"/) { # **bold** $d =~ s/\*\*([^ ]*)\*\*/\\fB$1\\fP/g; @@ -127,8 +133,25 @@ sub protocols { } } +sub too_old { + my ($version)=@_; + if($version =~ /^(\d+)\.(\d+)\.(\d+)/) { + my $a = $1 * 1000 + $2 * 10 + $3; + if($a < 7300) { + # we consider everything before 7.30.0 to be too old to mention + # specific changes for + return 1; + } + } + return 0; +} + sub added { my ($standalone, $data)=@_; + if(too_old($data)) { + # don't mention ancient additions + return ""; + } if($standalone) { return ".SH \"ADDED\"\nAdded in curl version $data\n"; } |