# get the long name version, return the manpage string
sub manpageify {
- my ($k)=@_;
- my $l;
+ my ($k, $manpage)=@_;
my $trail = '';
# the matching pattern might include a trailing dot that cannot be part of
# the option name
# cut off trailing dot
$trail = ".";
}
- my $klong = $k;
- # quote "bare" minuses in the long name
- $klong =~ s/-/\\-/g;
- if($optlong{$k}) {
- # both short + long
- $l = "\\fI-".$optlong{$k}.", \\-\\-$klong\\fP$trail";
- }
- else {
+ if($manpage) {
+ my $klong = $k;
+ # quote "bare" minuses in the long name
+ $klong =~ s/-/\\-/g;
+
# only long
- $l = "\\fI\\-\\-$klong\\fP$trail";
+ return "\\fI\\-\\-$klong\\fP$trail";
}
- return $l;
+ return "--$k$trail";
}
if($manpage) {
if(!$quote && $d =~ /--/) {
- $d =~ s/--([a-z0-9.-]+)/manpageify($1)/ge;
+ $d =~ s/--([a-z0-9.-]+)/manpageify($1, 1)/ge;
}
# quote minuses in the output
}
if($scope eq "global") {
push @desc, "\n" if(!$manpage);
- push @desc, "${pre}This option is global and does not need to be specified for each use of --next.\n";
+ push @desc,
+ sprintf("${pre}This option is global and does not need to be specified for each use of %s.\n",
+ manpageify("next", $manpage));
}
else {
print STDERR "$f:$line:1:ERROR: unrecognized scope: '$scope'\n";
my @extra;
if($multi eq "single") {
- push @extra, "${pre}If --$long is provided several times, the last set ".
- "value is used.\n";
+ push @extra,
+ sprintf("${pre}If %s is provided several times, the last set ".
+ "value is used.\n",
+ manpageify($long, $manpage));
}
elsif($multi eq "append") {
- push @extra, "${pre}--$long can be used several times in a command line\n";
+ push @extra,
+ sprintf("${pre}%s can be used several times in a command line\n",
+ manpageify($long, $manpage));
}
elsif($multi eq "boolean") {
my $rev = "no-$long";
}
my $dashes = $manpage ? "\\-\\-" : "--";
push @extra,
- "${pre}Providing --$long multiple times has no extra effect.\n".
- "Disable it again with $dashes$rev.\n";
+ sprintf("${pre}Providing %s multiple times has no extra effect.\n".
+ "Disable it again with $dashes$rev.\n",
+ manpageify($long, $manpage));
}
elsif($multi eq "mutex") {
push @extra,
- "${pre}Providing --$long multiple times has no extra effect.\n";
+ sprintf("${pre}Providing %s multiple times has no extra effect.\n",
+ manpageify($long, $manpage));
}
elsif($multi eq "custom") {
; # left for the text to describe
}
elsif($multi eq "per-URL") {
push @extra,
- "${pre}--$long is associated with a single URL. Use it once per URL ".
- "when you use several URLs in a command line.\n";
+ sprintf("${pre}%s is associated with a single URL. Use it once per URL ".
+ "when you use several URLs in a command line.\n",
+ manpageify($long, $manpage));
}
else {
print STDERR "$f:$line:1:ERROR: unrecognized Multi: '$multi'\n";
if(!$helplong{$k}) {
print STDERR "$f:$line:1:WARN: see-also a non-existing option: $k\n";
}
- my $l = $manpage ? manpageify($k) : "--$k";
+ my $l = manpageify($k, $manpage);
my $sep = " and";
if($and && ($i < $and)) {
$sep = ",";
}
if($requires) {
- my $l = $manpage ? manpageify($long) : "--$long";
+ my $l = manpageify($long, $manpage);
push @foot, "$l requires that libcurl".
" is built to support $requires.\n";
}
if(!$helplong{$k}) {
print STDERR "WARN: $f mutexes a non-existing option: $k\n";
}
- my $l = $manpage ? manpageify($k) : "--$k";
+ my $l = manpageify($k, $manpage);
my $sep = ", ";
if($count == ($num -1)) {
$sep = " and ";
hello
.fi
-This option is global and does not need to be specified for each use of --next.
+This option is global and does not need to be specified for each use of \fI\-\-next\fP.
-Providing --fakeitreal multiple times has no extra effect.
+Providing \fI\-\-fakeitreal\fP multiple times has no extra effect.
Disable it again with \-\-no-fakeitreal.
Example:
This option can be used multiple times, in which case the effect is the same
as concatenating the protocols into one instance of the option.
-If --proto is provided several times, the last set value is used.
+If \fI\-\-proto\fP is provided several times, the last set value is used.
Example:
.nf
curl --proto =http,https,sftp https://example.com
.fi
-See also \fI-v, \-\-fakeitreal\fP and \fI\-\-proto\-default\fP.
+See also \fI\-\-fakeitreal\fP and \fI\-\-proto\-default\fP.
.SH PROXY PROTOCOL PREFIXES
The proxy string may be specified with a protocol:// prefix to specify
alternative proxy protocols.