managen: introduce "Multi: per-URL"

For -O, -o and -T that are used once per specified URL.

Closes #14045
This commit is contained in:
Daniel Stenberg 2024-06-27 22:54:28 +02:00
Родитель 9acf759455
Коммит 2d3a51e367
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
5 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -45,7 +45,7 @@ A line that starts with `<!--` is a comment. It should also end with `-->`.
Help: (short text for the --help output for this option)
Long: (long form name, without dashes)
Magic: (description of "magic" options)
Multi: single/append/boolean/mutex/custom (if used more than once)
Multi: single/append/boolean/mutex/custom/per-URL (if used more than once)
Mutexed: (space separated list of options this overrides, no dashes)
Protocols: (space separated list for which protocols this option works)
Requires: (space separated list of features this requires, no dashes)

Просмотреть файл

@ -7,7 +7,7 @@ Short: o
Help: Write to file instead of stdout
Category: important curl
Added: 4.0
Multi: append
Multi: per-URL
See-also:
- remote-name
- remote-name-all

Просмотреть файл

@ -6,13 +6,14 @@ Short: O
Help: Write output to file named as remote file
Category: important output
Added: 4.0
Multi: append
Multi: per-URL
See-also:
- remote-name-all
- output-dir
- remote-header-name
Example:
- -O https://example.com/filename
- -O https://example.com/filename -O https://example.com/file2
---
# `--remote-name`

Просмотреть файл

@ -7,7 +7,7 @@ Arg: <file>
Help: Transfer local FILE to destination
Category: important upload
Added: 4.0
Multi: append
Multi: per-URL
See-also:
- get
- head
@ -17,6 +17,7 @@ Example:
- -T file $URL
- -T "img[1-1000].png" ftp://ftp.example.com/
- --upload-file "{file1,file2}" $URL
- -T file -T file2 $URL $URL
---
# `--upload-file`

Просмотреть файл

@ -704,6 +704,11 @@ sub single {
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\n".
"when you use several URLs in a command line.\n";
}
else {
print STDERR "$f:$line:1:ERROR: unrecognized Multi: '$multi'\n";
return 2;