mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
managen: verify the options used in example lines
Also fix the --knownhosts typo
Follow-up to aae18c4bdc
Reported-by: Daniel Terhorst-North
URL: https://mas.to/@tastapod/115327102344617386
Closes #18884
This commit is contained in:
parent
6c7fc22f9d
commit
3b18aeb8bd
4 changed files with 28 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ See-also:
|
||||||
- insecure
|
- insecure
|
||||||
- key
|
- key
|
||||||
Example:
|
Example:
|
||||||
- --knownhost filename --key here $URL
|
- --knownhosts filename --key here $URL
|
||||||
---
|
---
|
||||||
|
|
||||||
# `--knownhosts`
|
# `--knownhosts`
|
||||||
|
|
|
||||||
|
|
@ -880,6 +880,29 @@ sub single {
|
||||||
if($examples[0]) {
|
if($examples[0]) {
|
||||||
my $s ="";
|
my $s ="";
|
||||||
$s="s" if($examples[1]);
|
$s="s" if($examples[1]);
|
||||||
|
foreach my $e (@examples) {
|
||||||
|
my $check = $e;
|
||||||
|
# verify the used options
|
||||||
|
for my $e (split(/ /, $check)) {
|
||||||
|
if($e =~ /^-([^- ])/) {
|
||||||
|
my $opt = $1;
|
||||||
|
if(!$optshort{$opt}) {
|
||||||
|
print STDERR "$f:$line:1:ERROR: unknown option in ".
|
||||||
|
"example: -$opt\n";
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elsif($e =~ /^--([^ =]*)/) {
|
||||||
|
my $opt = $1;
|
||||||
|
$opt =~ s/^expand-//g;
|
||||||
|
if(!$helplong{$opt}) {
|
||||||
|
print STDERR "$f:$line:1:ERROR: unknown option in ".
|
||||||
|
"example: '--$opt'\n";
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if($manpage) {
|
if($manpage) {
|
||||||
print "\nExample$s:\n";
|
print "\nExample$s:\n";
|
||||||
print ".nf\n";
|
print ".nf\n";
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ See-also:
|
||||||
- trace
|
- trace
|
||||||
- trace-ascii
|
- trace-ascii
|
||||||
Example:
|
Example:
|
||||||
- --verbose $URL
|
- --fakeitreal $URL
|
||||||
---
|
---
|
||||||
|
|
||||||
# `--verbose`
|
# `--verbose`
|
||||||
|
|
@ -231,7 +231,7 @@ Disable it again with \-\-no-fakeitreal.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.nf
|
.nf
|
||||||
curl --verbose https://example.com
|
curl --fakeitreal https://example.com
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
This option is mutually exclusive with \fI\-\-trace\fP and \fI\-\-trace\-ascii\fP.
|
This option is mutually exclusive with \fI\-\-trace\fP and \fI\-\-trace\-ascii\fP.
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ See-also:
|
||||||
- trace
|
- trace
|
||||||
- trace-ascii
|
- trace-ascii
|
||||||
Example:
|
Example:
|
||||||
- --verbose $URL
|
- --fakeitreal $URL
|
||||||
---
|
---
|
||||||
|
|
||||||
# `--verbose`
|
# `--verbose`
|
||||||
|
|
@ -196,7 +196,7 @@ DESCRIPTION
|
||||||
effect. Disable it again with --no-fakeitreal.
|
effect. Disable it again with --no-fakeitreal.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
curl --verbose https://example.com
|
curl --fakeitreal https://example.com
|
||||||
|
|
||||||
This option is mutually exclusive with --trace and --trace-ascii.
|
This option is mutually exclusive with --trace and --trace-ascii.
|
||||||
See also --include, --silent, --trace and --trace-ascii.
|
See also --include, --silent, --trace and --trace-ascii.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue