summaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/gen.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-11-15 15:58:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-11-15 23:06:41 +0100
commitddaa85893d8ca62b96454de3a98ebb4e750fdc36 (patch)
tree632ad83c371601110b24442ce12124f3470f61cd /docs/cmdline-opts/gen.pl
parentf5f12331e5375073a6af9017e690c66fcc11fc2b (diff)
downloadcurl-ddaa85893d8ca62b96454de3a98ebb4e750fdc36.tar.gz
curl.1: require "see also" for every documented option
gen.pl now generates a warning if the "See Also" field is not filled in for a command line option All command line options now provide one or more related options. 167 "See alsos" added! Closes #8019
Diffstat (limited to 'docs/cmdline-opts/gen.pl')
-rwxr-xr-xdocs/cmdline-opts/gen.pl20
1 files changed, 12 insertions, 8 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index f6f6ce8be..3d15f1b54 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -239,19 +239,23 @@ sub single {
elsif(/^---/) {
if(!$long) {
print STDERR "ERROR: no 'Long:' in $f\n";
- exit 1;
+ return 1;
}
if(!$category) {
print STDERR "ERROR: no 'Category:' in $f\n";
- exit 2;
+ return 2;
}
if(!$examples[0]) {
print STDERR "$f:$line:1:ERROR: no 'Example:' present\n";
- exit 2;
+ return 2;
}
if(!$added) {
print STDERR "$f:$line:1:ERROR: no 'Added:' version present\n";
- exit 2;
+ return 2;
+ }
+ if(!$seealso) {
+ print STDERR "$f:$line:1:ERROR: no 'See-also:' field present\n";
+ return 2;
}
last;
}
@@ -315,7 +319,7 @@ sub single {
my $i = 0;
for my $k (@m) {
if(!$helplong{$k}) {
- print STDERR "WARN: $f see-alsos a non-existing option: $k\n";
+ print STDERR "$f:$line:1:WARN: see-also a non-existing option: $k\n";
}
my $l = manpageify($k);
my $sep = " and";
@@ -533,17 +537,17 @@ sub listcats {
sub mainpage {
my (@files) = @_;
+ my $ret;
# show the page header
header("page-header");
# output docs for all options
foreach my $f (sort @files) {
- if(single($f, 0)) {
- print STDERR "Can't read $f?\n";
- }
+ $ret += single($f, 0);
}
header("page-footer");
+ exit $ret if($ret);
}
sub showonly {