summaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/gen.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-11-16 10:42:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-11-16 10:42:50 +0100
commit81e61cda396da7eefb15dcf20b9e8be7ada37283 (patch)
tree19b0bfef040f287a7aeae988896c4be309c46a67 /docs/cmdline-opts/gen.pl
parent1ef1f10cab9dd6ca4b2e0e5fea9341a897a589bf (diff)
downloadcurl-81e61cda396da7eefb15dcf20b9e8be7ada37283.tar.gz
gen: support 'redirect'
... and warn for too long --help lines
Diffstat (limited to 'docs/cmdline-opts/gen.pl')
-rwxr-xr-xdocs/cmdline-opts/gen.pl43
1 files changed, 29 insertions, 14 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index 680031003..ba405a4a6 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -10,6 +10,7 @@ my %optshort;
my %optlong;
my %helplong;
my %arglong;
+my %redirlong;
# get the long name version, return the man page string
sub manpageify {
@@ -51,6 +52,7 @@ sub single {
my $arg;
my $mutexed;
my $requires;
+ my $redirect;
my $seealso;
my $magic; # cmdline special option
while(<F>) {
@@ -84,6 +86,9 @@ sub single {
elsif(/^Requires: (.*)/i) {
$requires=$1;
}
+ elsif(/^Redirect: (.*)/i) {
+ $redirect=$1;
+ }
elsif(/^---/) {
last;
}
@@ -109,22 +114,27 @@ sub single {
}
print ".IP \"$opt\"\n";
- my $o;
- if($protocols) {
- $o++;
- print "($protocols) ";
- }
- if(!$arg && !$mutexed && !$magic) {
- $o++;
- print "[Boolean] ";
+ if($redirect) {
+ my $l = manpageify($redirect);
+ print "Use $l instead!\n";
}
- if($magic) {
- $o++;
- print "[cmdline control] ";
+ else {
+ my $o;
+ if($protocols) {
+ $o++;
+ print "($protocols) ";
+ }
+ if(!$arg && !$mutexed && !$magic) {
+ $o++;
+ print "[Boolean] ";
+ }
+ if($magic) {
+ $o++;
+ print "[cmdline control] ";
+ }
+ print "\n" if($o);
}
- print "\n" if($o);
-
printdesc(@desc);
undef @desc;
@@ -231,7 +241,12 @@ sub listhelp {
$opt .= " $arg";
}
- printf " %-19s %s\n", $opt, $helplong{$f};
+ my $line = sprintf " %-19s %s\n", $opt, $helplong{$f};
+
+ if(length($line) > 79) {
+ print STDERR "WARN: the --$long line is too long\n";
+ }
+ print $line;
}
}