cmdline-opts: category cleanup

Option cleanups:

 --get is not upload
 --form* are post
 - added several options into ldap, smtp, imap and pop3
 - shortened the category descriptions in the list

category curl fixes:

 --create-dirs removed from 'curl'
 --ftp-create-dirs removed from 'curl'
 --netrc moved to 'auth' from 'curl'
 --netrc-file moved to 'auth' from 'curl'
 --netrc-optional moved to 'auth' from 'curl'
 --no-buffer moved to 'output' from 'curl'
 --no-clobber removed from 'curl'
 --output removed from 'curl'
 --output-dir removed from 'curl'
 --remove-on-error removed from 'curl'

Add a "global" category:

- Made all "global" options set this category

Add a "deprecated" category:

- Moved the deprecated options to it (maybe they should not be in any
 category long term)

Add a 'timeout' category

- Put a number of appropriate options in it

Add an 'ldap' category

- Put the LDAP related option in there

Remove categories "ECH" and "ipfs"

- They should not be categories. Had only one single option each.

Remove category "misc"

- It should not be a category as it is impossible to know when to browse
  it.

--use-ascii moved to ftp and output
--xattr moved to output
--service-name moved to auth

Managen fixes:

- errors if an option is given a category name that is not already setup
  for in code

- verifies that options set `scope: global` also is put in category
  `global´

Closes #14101
This commit is contained in:
Daniel Stenberg 2024-07-04 13:38:18 +02:00
parent 18c61aa036
commit 2abfc759b9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
64 changed files with 239 additions and 204 deletions

View file

@ -54,7 +54,7 @@ $(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
$(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE)) $(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
listhelp: listhelp:
$(MANAGEN) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c $(MANAGEN) -d $(srcdir) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c
listcats: listcats:
@$(MANAGEN) listcats $(DPAGES) @$(MANAGEN) listcats $(DPAGES)

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: connect-timeout Long: connect-timeout
Arg: <seconds> Arg: <seconds>
Help: Maximum time allowed to connect Help: Maximum time allowed to connect
Category: connection Category: connection timeout
Added: 7.7 Added: 7.7
Multi: single Multi: single
See-also: See-also:

View file

@ -3,9 +3,9 @@ c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: connect-to Long: connect-to
Arg: <HOST1:PORT1:HOST2:PORT2> Arg: <HOST1:PORT1:HOST2:PORT2>
Help: Connect to host Help: Connect to host2 instead of host1
Added: 7.49.0 Added: 7.49.0
Category: connection Category: connection dns
Multi: append Multi: append
See-also: See-also:
- resolve - resolve

View file

@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: create-dirs Long: create-dirs
Help: Create necessary local directory hierarchy Help: Create necessary local directory hierarchy
Category: curl output Category: output
Added: 7.10.3 Added: 7.10.3
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: ech
Arg: <config> Arg: <config>
Help: Configure ECH Help: Configure ECH
Added: 8.8.0 Added: 8.8.0
Category: tls ECH Category: tls
Protocols: HTTPS Protocols: HTTPS
Multi: single Multi: single
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: egd-file
Arg: <file> Arg: <file>
Help: EGD socket path for random data Help: EGD socket path for random data
Protocols: TLS Protocols: TLS
Category: tls Category: deprecated
Added: 7.7 Added: 7.7
Multi: single Multi: single
See-also: See-also:

View file

@ -6,7 +6,7 @@ Arg: <seconds>
Help: How long to wait for 100-continue Help: How long to wait for 100-continue
Protocols: HTTP Protocols: HTTP
Added: 7.47.0 Added: 7.47.0
Category: http Category: http timeout
Multi: single Multi: single
See-also: See-also:
- connect-timeout - connect-timeout

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: fail-early Long: fail-early
Help: Fail on first transfer error Help: Fail on first transfer error
Added: 7.52.0 Added: 7.52.0
Category: curl Category: curl global
Multi: boolean Multi: boolean
Scope: global Scope: global
See-also: See-also:

View file

@ -3,9 +3,9 @@ c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: form-escape Long: form-escape
Help: Escape form fields using backslash Help: Escape form fields using backslash
Protocols: HTTP Protocols: HTTP imap smtp
Added: 7.81.0 Added: 7.81.0
Category: http upload Category: http upload post
Multi: single Multi: single
See-also: See-also:
- form - form

View file

@ -5,7 +5,7 @@ Long: form-string
Help: Specify multipart MIME data Help: Specify multipart MIME data
Protocols: HTTP SMTP IMAP Protocols: HTTP SMTP IMAP
Arg: <name=string> Arg: <name=string>
Category: http upload Category: http upload post smtp imap
Added: 7.13.2 Added: 7.13.2
Multi: append Multi: append
See-also: See-also:

View file

@ -7,7 +7,7 @@ Arg: <name=content>
Help: Specify multipart MIME data Help: Specify multipart MIME data
Protocols: HTTP SMTP IMAP Protocols: HTTP SMTP IMAP
Mutexed: data head upload-file Mutexed: data head upload-file
Category: http upload Category: http upload post imap smtp
Added: 5.0 Added: 5.0
Multi: append Multi: append
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: ftp-create-dirs Long: ftp-create-dirs
Protocols: FTP SFTP Protocols: FTP SFTP
Help: Create the remote dirs if not present Help: Create the remote dirs if not present
Category: ftp sftp curl Category: ftp sftp
Added: 7.10.7 Added: 7.10.7
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: get
Short: G Short: G
Help: Put the post data in the URL and use GET Help: Put the post data in the URL and use GET
Protocols: HTTP Protocols: HTTP
Category: http upload Category: http
Added: 7.8.1 Added: 7.8.1
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: happy-eyeballs-timeout-ms
Arg: <ms> Arg: <ms>
Help: Time for IPv6 before IPv4 Help: Time for IPv6 before IPv4
Added: 7.59.0 Added: 7.59.0
Category: connection Category: connection timeout
Multi: single Multi: single
See-also: See-also:
- max-time - max-time

View file

@ -6,7 +6,7 @@ Arg: <URL>
Help: Gateway for IPFS Help: Gateway for IPFS
Protocols: IPFS Protocols: IPFS
Added: 8.4.0 Added: 8.4.0
Category: ipfs Category: curl
Multi: single Multi: single
See-also: See-also:
- help - help

View file

@ -5,7 +5,7 @@ Long: keepalive-time
Arg: <seconds> Arg: <seconds>
Help: Interval time for keepalive probes Help: Interval time for keepalive probes
Added: 7.18.0 Added: 7.18.0
Category: connection Category: connection timeout
Multi: single Multi: single
See-also: See-also:
- no-keepalive - no-keepalive

View file

@ -5,7 +5,7 @@ Long: libcurl
Arg: <file> Arg: <file>
Help: Generate libcurl code for this command line Help: Generate libcurl code for this command line
Added: 7.16.1 Added: 7.16.1
Category: curl Category: curl global
Multi: single Multi: single
Scope: global Scope: global
See-also: See-also:

View file

@ -6,7 +6,7 @@ Arg: <options>
Protocols: IMAP LDAP POP3 SMTP Protocols: IMAP LDAP POP3 SMTP
Help: Server login options Help: Server login options
Added: 7.34.0 Added: 7.34.0
Category: imap pop3 smtp auth Category: imap pop3 smtp auth ldap
Multi: single Multi: single
See-also: See-also:
- user - user

View file

@ -5,7 +5,7 @@ Long: max-time
Short: m Short: m
Arg: <seconds> Arg: <seconds>
Help: Maximum time allowed for transfer Help: Maximum time allowed for transfer
Category: connection Category: connection timeout
Added: 4.0 Added: 4.0
Multi: single Multi: single
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: metalink Long: metalink
Help: Process given URLs as metalink XML file Help: Process given URLs as metalink XML file
Added: 7.27.0 Added: 7.27.0
Category: misc Category: deprecated
Multi: single Multi: single
See-also: See-also:
- parallel - parallel

View file

@ -6,7 +6,7 @@ Help: Specify FILE for netrc
Arg: <filename> Arg: <filename>
Added: 7.21.5 Added: 7.21.5
Mutexed: netrc Mutexed: netrc
Category: curl Category: auth
Multi: single Multi: single
See-also: See-also:
- netrc - netrc

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: netrc-optional Long: netrc-optional
Help: Use either .netrc or URL Help: Use either .netrc or URL
Mutexed: netrc Mutexed: netrc
Category: curl Category: auth
Added: 7.9.8 Added: 7.9.8
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: netrc Long: netrc
Short: n Short: n
Help: Must read .netrc for username and password Help: Must read .netrc for username and password
Category: curl Category: auth
Added: 4.6 Added: 4.6
Mutexed: netrc-file netrc-optional Mutexed: netrc-file netrc-optional
Multi: boolean Multi: boolean

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: no-buffer Long: no-buffer
Short: N Short: N
Help: Disable buffering of the output stream Help: Disable buffering of the output stream
Category: curl Category: output
Added: 6.5 Added: 6.5
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: no-clobber Long: no-clobber
Help: Do not overwrite files that already exist Help: Do not overwrite files that already exist
Category: curl output Category: output
Added: 7.83.0 Added: 7.83.0
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: ntlm-wb Long: ntlm-wb
Help: HTTP NTLM authentication with winbind Help: HTTP NTLM authentication with winbind
Protocols: HTTP Protocols: HTTP
Category: auth http Category: deprecated
Added: 7.22.0 Added: 7.22.0
Multi: mutex Multi: mutex
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: oauth2-bearer
Help: OAuth 2 Bearer Token Help: OAuth 2 Bearer Token
Arg: <token> Arg: <token>
Protocols: IMAP LDAP POP3 SMTP HTTP Protocols: IMAP LDAP POP3 SMTP HTTP
Category: auth Category: auth imap pop3 smtp ldap
Added: 7.33.0 Added: 7.33.0
Multi: single Multi: single
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: output-dir
Arg: <dir> Arg: <dir>
Help: Directory to save files in Help: Directory to save files in
Added: 7.73.0 Added: 7.73.0
Category: curl output Category: output
Multi: single Multi: single
See-also: See-also:
- remote-name - remote-name

View file

@ -5,7 +5,7 @@ Long: output
Arg: <file> Arg: <file>
Short: o Short: o
Help: Write to file instead of stdout Help: Write to file instead of stdout
Category: important curl output Category: important output
Added: 4.0 Added: 4.0
Multi: per-URL Multi: per-URL
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: parallel-immediate Long: parallel-immediate
Help: Do not wait for multiplexing Help: Do not wait for multiplexing
Added: 7.68.0 Added: 7.68.0
Category: connection curl Category: connection curl global
Multi: boolean Multi: boolean
Scope: global Scope: global
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: parallel-max
Arg: <num> Arg: <num>
Help: Maximum concurrency for parallel transfers Help: Maximum concurrency for parallel transfers
Added: 7.66.0 Added: 7.66.0
Category: connection curl Category: connection curl global
Multi: single Multi: single
Scope: global Scope: global
See-also: See-also:

View file

@ -5,7 +5,7 @@ Short: Z
Long: parallel Long: parallel
Help: Perform transfers in parallel Help: Perform transfers in parallel
Added: 7.66.0 Added: 7.66.0
Category: connection curl Category: connection curl global
Multi: boolean Multi: boolean
Scope: global Scope: global
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Short: # Short: #
Long: progress-bar Long: progress-bar
Help: Display transfer progress as a bar Help: Display transfer progress as a bar
Category: verbose Category: verbose global
Added: 5.10 Added: 5.10
Multi: boolean Multi: boolean
Scope: global Scope: global

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: random-file Long: random-file
Arg: <file> Arg: <file>
Help: File for reading random data from Help: File for reading random data from
Category: misc Category: deprecated
Added: 7.7 Added: 7.7
Multi: single Multi: single
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: rate Long: rate
Arg: <max request rate> Arg: <max request rate>
Help: Request rate for serial transfers Help: Request rate for serial transfers
Category: connection Category: connection global
Added: 7.84.0 Added: 7.84.0
Multi: single Multi: single
Scope: global Scope: global

View file

@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: remove-on-error Long: remove-on-error
Help: Remove output file on errors Help: Remove output file on errors
Category: curl output Category: output
Added: 7.83.0 Added: 7.83.0
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: request
Short: X Short: X
Arg: <method> Arg: <method>
Help: Specify request method to use Help: Specify request method to use
Category: connection Category: connection pop3 ftp imap smtp
Added: 6.0 Added: 6.0
Multi: single Multi: single
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: retry-delay
Arg: <seconds> Arg: <seconds>
Help: Wait time between retries Help: Wait time between retries
Added: 7.12.3 Added: 7.12.3
Category: curl Category: curl timeout
Multi: single Multi: single
See-also: See-also:
- retry - retry

View file

@ -5,7 +5,7 @@ Long: retry-max-time
Arg: <seconds> Arg: <seconds>
Help: Retry only within this period Help: Retry only within this period
Added: 7.12.3 Added: 7.12.3
Category: curl Category: curl timeout
Multi: single Multi: single
See-also: See-also:
- retry - retry

View file

@ -5,7 +5,7 @@ Long: service-name
Help: SPNEGO service name Help: SPNEGO service name
Arg: <name> Arg: <name>
Added: 7.43.0 Added: 7.43.0
Category: misc Category: auth
Multi: single Multi: single
See-also: See-also:
- negotiate - negotiate

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: show-error Long: show-error
Short: S Short: S
Help: Show error even when -s is used Help: Show error even when -s is used
Category: curl Category: curl global
Added: 5.9 Added: 5.9
Multi: boolean Multi: boolean
Scope: global Scope: global

View file

@ -33,4 +33,4 @@ used with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first
connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or
HTTPS proxy. HTTPS proxy.
This option (as well as --socks4) does not work with IPV6, FTPS or LDAP. This option does not work with FTPS or LDAP.

View file

@ -5,7 +5,7 @@ Long: speed-time
Short: y Short: y
Arg: <seconds> Arg: <seconds>
Help: Trigger 'speed-limit' abort after this time Help: Trigger 'speed-limit' abort after this time
Category: connection Category: connection timeout
Added: 4.7 Added: 4.7
Multi: single Multi: single
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: ssl-reqd
Help: Require SSL/TLS Help: Require SSL/TLS
Protocols: FTP IMAP POP3 SMTP LDAP Protocols: FTP IMAP POP3 SMTP LDAP
Added: 7.20.0 Added: 7.20.0
Category: tls Category: tls imap pop3 smtp ldap
Multi: boolean Multi: boolean
See-also: See-also:
- ssl - ssl

View file

@ -5,7 +5,7 @@ Long: ssl
Help: Try enabling TLS Help: Try enabling TLS
Protocols: FTP IMAP POP3 SMTP LDAP Protocols: FTP IMAP POP3 SMTP LDAP
Added: 7.20.0 Added: 7.20.0
Category: tls Category: tls imap pop3 smtp ldap
Multi: boolean Multi: boolean
See-also: See-also:
- ssl-reqd - ssl-reqd

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: stderr Long: stderr
Arg: <file> Arg: <file>
Help: Where to redirect stderr Help: Where to redirect stderr
Category: verbose Category: verbose global
Added: 6.2 Added: 6.2
Multi: single Multi: single
Scope: global Scope: global

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: styled-output Long: styled-output
Help: Enable styled output for HTTP headers Help: Enable styled output for HTTP headers
Added: 7.61.0 Added: 7.61.0
Category: verbose Category: verbose global
Multi: boolean Multi: boolean
Scope: global Scope: global
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: trace-ascii
Arg: <file> Arg: <file>
Help: Like --trace, but without hex output Help: Like --trace, but without hex output
Mutexed: trace verbose Mutexed: trace verbose
Category: verbose Category: verbose global
Added: 7.9.7 Added: 7.9.7
Multi: single Multi: single
Scope: global Scope: global

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: trace-config Long: trace-config
Arg: <string> Arg: <string>
Help: Details to log in trace/verbose output Help: Details to log in trace/verbose output
Category: verbose Category: verbose global
Added: 8.3.0 Added: 8.3.0
Multi: append Multi: append
Scope: global Scope: global

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: trace-ids Long: trace-ids
Help: Transfer + connection ids in verbose output Help: Transfer + connection ids in verbose output
Added: 8.2.0 Added: 8.2.0
Category: verbose Category: verbose global
Multi: boolean Multi: boolean
Scope: global Scope: global
See-also: See-also:

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: curl
Long: trace-time Long: trace-time
Help: Add time stamps to trace/verbose output Help: Add time stamps to trace/verbose output
Added: 7.14.0 Added: 7.14.0
Category: verbose Category: verbose global
Multi: boolean Multi: boolean
Scope: global Scope: global
See-also: See-also:

View file

@ -5,7 +5,7 @@ Long: trace
Arg: <file> Arg: <file>
Help: Write a debug trace to FILE Help: Write a debug trace to FILE
Mutexed: verbose trace-ascii Mutexed: verbose trace-ascii
Category: verbose Category: verbose global
Added: 7.9.7 Added: 7.9.7
Multi: single Multi: single
Scope: global Scope: global

View file

@ -5,7 +5,7 @@ Short: B
Long: use-ascii Long: use-ascii
Help: Use ASCII/text transfer Help: Use ASCII/text transfer
Protocols: FTP LDAP Protocols: FTP LDAP
Category: misc Category: ftp output ldap
Added: 5.0 Added: 5.0
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -5,7 +5,7 @@ Short: v
Long: verbose Long: verbose
Mutexed: trace trace-ascii Mutexed: trace trace-ascii
Help: Make the operation more talkative Help: Make the operation more talkative
Category: important verbose Category: important verbose global
Added: 4.0 Added: 4.0
Multi: boolean Multi: boolean
Scope: global Scope: global

View file

@ -3,7 +3,7 @@ c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl SPDX-License-Identifier: curl
Long: xattr Long: xattr
Help: Store metadata in extended file attributes Help: Store metadata in extended file attributes
Category: misc Category: output
Added: 7.21.3 Added: 7.21.3
Multi: boolean Multi: boolean
See-also: See-also:

View file

@ -667,6 +667,10 @@ sub single {
my $pre = $manpage ? "\n": "[1]"; my $pre = $manpage ? "\n": "[1]";
if($scope) { if($scope) {
if($category !~ /global/) {
print STDERR "$f:$line:1:ERROR: global scope option does not have global category\n";
return 2;
}
if($scope eq "global") { if($scope eq "global") {
push @desc, "\n" if(!$manpage); 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, "${pre}This option is global and does not need to be specified for each use of --next.\n";
@ -885,7 +889,25 @@ sub header {
printdesc($manpage, 0, @d); printdesc($manpage, 0, @d);
} }
sub sourcecategories {
my ($dir) = @_;
my %cats;
open(H, "<$dir/../../src/tool_help.h") ||
die "can't find the header file";
while(<H>) {
if(/^\#define CURLHELP_([A-Z0-9]*)/) {
$cats{lc($1)}++;
}
}
close(H);
return %cats;
}
sub listhelp { sub listhelp {
my ($dir) = @_;
my %cats = sourcecategories($dir);
print <<HEAD print <<HEAD
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
@ -938,6 +960,12 @@ HEAD
$opt = " --$long"; $opt = " --$long";
} }
for my $i (0 .. $#categories) { for my $i (0 .. $#categories) {
if(!$cats{ $categories[$i] }) {
printf STDERR "$f.md:ERROR: Unknown category '%s'\n",
$categories[$i];
exit 3;
}
$bitmask .= 'CURLHELP_' . uc $categories[$i]; $bitmask .= 'CURLHELP_' . uc $categories[$i];
# If not last element, append | # If not last element, append |
if($i < $#categories) { if($i < $#categories) {
@ -963,7 +991,7 @@ HEAD
print $line; print $line;
} }
print <<FOOT print <<FOOT
{ NULL, NULL, CURLHELP_HIDDEN } { NULL, NULL, 0 }
}; };
FOOT FOOT
; ;
@ -982,9 +1010,9 @@ sub listcats {
push @categories, $key; push @categories, $key;
} }
@categories = sort @categories; @categories = sort @categories;
unshift @categories, 'hidden';
for my $i (0..$#categories) { for my $i (0..$#categories) {
print '#define ' . 'CURLHELP_' . uc($categories[$i]) . ' ' . "1u << " . $i . "u\n"; printf("#define CURLHELP_%-10s (%s)\n",
uc($categories[$i]), "1u << ${i}u");
} }
} }
@ -1129,7 +1157,7 @@ sub getargs {
return; return;
} }
elsif($f eq "listhelp") { elsif($f eq "listhelp") {
listhelp(); listhelp($dir);
return; return;
} }
elsif($f eq "single") { elsif($f eq "single") {

View file

@ -42,41 +42,39 @@
struct category_descriptors { struct category_descriptors {
const char *opt; const char *opt;
const char *desc; const char *desc;
curlhelp_t category; unsigned int category;
}; };
static const struct category_descriptors categories[] = { static const struct category_descriptors categories[] = {
{"auth", "Different types of authentication methods", CURLHELP_AUTH},
{"connection", "Low level networking operations",
CURLHELP_CONNECTION},
{"curl", "The command line tool itself", CURLHELP_CURL},
{"dns", "General DNS options", CURLHELP_DNS},
{"file", "FILE protocol options", CURLHELP_FILE},
{"ftp", "FTP protocol options", CURLHELP_FTP},
{"http", "HTTP and HTTPS protocol options", CURLHELP_HTTP},
{"imap", "IMAP protocol options", CURLHELP_IMAP},
/* important is left out because it is the default help page */ /* important is left out because it is the default help page */
{"misc", "Options that do not fit into any other category", CURLHELP_MISC}, {"auth", "Authentication methods", CURLHELP_AUTH},
{"connection", "Manage connections", CURLHELP_CONNECTION},
{"curl", "The command line tool itself", CURLHELP_CURL},
{"deprecated", "Legacy", CURLHELP_DEPRECATED},
{"dns", "Names and resolving", CURLHELP_DNS},
{"file", "FILE protocol", CURLHELP_FILE},
{"ftp", "FTP protocol", CURLHELP_FTP},
{"global", "Global options", CURLHELP_GLOBAL},
{"http", "HTTP and HTTPS protocol", CURLHELP_HTTP},
{"imap", "IMAP protocol", CURLHELP_IMAP},
{"ldap", "LDAP protocol", CURLHELP_LDAP},
{"output", "Filesystem output", CURLHELP_OUTPUT}, {"output", "Filesystem output", CURLHELP_OUTPUT},
{"pop3", "POP3 protocol options", CURLHELP_POP3}, {"pop3", "POP3 protocol", CURLHELP_POP3},
{"post", "HTTP Post specific options", CURLHELP_POST}, {"post", "HTTP POST specific", CURLHELP_POST},
{"proxy", "All options related to proxies", CURLHELP_PROXY}, {"proxy", "Options for proxies", CURLHELP_PROXY},
{"scp", "SCP protocol options", CURLHELP_SCP}, {"scp", "SCP protocol", CURLHELP_SCP},
{"sftp", "SFTP protocol options", CURLHELP_SFTP}, {"sftp", "SFTP protocol", CURLHELP_SFTP},
{"smtp", "SMTP protocol options", CURLHELP_SMTP}, {"smtp", "SMTP protocol", CURLHELP_SMTP},
{"ssh", "SSH protocol options", CURLHELP_SSH}, {"ssh", "SSH protocol", CURLHELP_SSH},
{"telnet", "TELNET protocol options", CURLHELP_TELNET}, {"telnet", "TELNET protocol", CURLHELP_TELNET},
{"tftp", "TFTP protocol options", CURLHELP_TFTP}, {"tftp", "TFTP protocol", CURLHELP_TFTP},
{"tls", "All TLS/SSL related options", CURLHELP_TLS}, {"timeout", "Timeouts and delays", CURLHELP_TIMEOUT},
{"ech", "All Encrypted Client Hello (ECH) options", CURLHELP_ECH}, {"tls", "TLS/SSL related", CURLHELP_TLS},
{"upload", "All options for uploads", {"upload", "Upload, sending data", CURLHELP_UPLOAD},
CURLHELP_UPLOAD}, {"verbose", "Tracing, logging etc", CURLHELP_VERBOSE}
{"verbose", "Options related to any kind of command line output of curl",
CURLHELP_VERBOSE},
{NULL, NULL, CURLHELP_HIDDEN}
}; };
static void print_category(curlhelp_t category, unsigned int cols) static void print_category(unsigned int category, unsigned int cols)
{ {
unsigned int i; unsigned int i;
size_t longopt = 5; size_t longopt = 5;
@ -114,7 +112,7 @@ static void print_category(curlhelp_t category, unsigned int cols)
static int get_category_content(const char *category, unsigned int cols) static int get_category_content(const char *category, unsigned int cols)
{ {
unsigned int i; unsigned int i;
for(i = 0; categories[i].opt; ++i) for(i = 0; i < sizeof(categories)/sizeof(categories[0]); ++i)
if(curl_strequal(categories[i].opt, category)) { if(curl_strequal(categories[i].opt, category)) {
printf("%s: %s\n", categories[i].opt, categories[i].desc); printf("%s: %s\n", categories[i].opt, categories[i].desc);
print_category(categories[i].category, cols); print_category(categories[i].category, cols);
@ -127,7 +125,7 @@ static int get_category_content(const char *category, unsigned int cols)
static void get_categories(void) static void get_categories(void)
{ {
unsigned int i; unsigned int i;
for(i = 0; categories[i].opt; ++i) for(i = 0; i < sizeof(categories)/sizeof(categories[0]); ++i)
printf(" %-11s %s\n", categories[i].opt, categories[i].desc); printf(" %-11s %s\n", categories[i].opt, categories[i].desc);
} }
@ -147,14 +145,14 @@ void tool_help(char *category)
} }
/* Lets print everything if "all" was provided */ /* Lets print everything if "all" was provided */
else if(curl_strequal(category, "all")) else if(curl_strequal(category, "all"))
/* Print everything except hidden */ /* Print everything */
print_category(~(CURLHELP_HIDDEN), cols); print_category(CURLHELP_ALL, cols);
/* Lets handle the string "category" differently to not print an errormsg */ /* Lets handle the string "category" differently to not print an errormsg */
else if(curl_strequal(category, "category")) else if(curl_strequal(category, "category"))
get_categories(); get_categories();
/* Otherwise print category and handle the case if the cat was not found */ /* Otherwise print category and handle the case if the cat was not found */
else if(get_category_content(category, cols)) { else if(get_category_content(category, cols)) {
puts("Invalid category provided, here is a list of all categories:\n"); puts("Unknown category provided, here is a list of all categories:\n");
get_categories(); get_categories();
} }
free(category); free(category);

View file

@ -29,12 +29,10 @@ void tool_help(char *category);
void tool_list_engines(void); void tool_list_engines(void);
void tool_version_info(void); void tool_version_info(void);
typedef unsigned int curlhelp_t;
struct helptxt { struct helptxt {
const char *opt; const char *opt;
const char *desc; const char *desc;
curlhelp_t categories; unsigned int categories;
}; };
/* /*
@ -43,32 +41,34 @@ struct helptxt {
make -C docs/cmdline-opts listcats make -C docs/cmdline-opts listcats
*/ */
#define CURLHELP_HIDDEN 1u << 0u #define CURLHELP_AUTH (1u << 0u)
#define CURLHELP_AUTH 1u << 1u #define CURLHELP_CONNECTION (1u << 1u)
#define CURLHELP_CONNECTION 1u << 2u #define CURLHELP_CURL (1u << 2u)
#define CURLHELP_CURL 1u << 3u #define CURLHELP_DEPRECATED (1u << 3u)
#define CURLHELP_DNS 1u << 4u #define CURLHELP_DNS (1u << 4u)
#define CURLHELP_FILE 1u << 5u #define CURLHELP_FILE (1u << 5u)
#define CURLHELP_FTP 1u << 6u #define CURLHELP_FTP (1u << 6u)
#define CURLHELP_HTTP 1u << 7u #define CURLHELP_GLOBAL (1u << 7u)
#define CURLHELP_IMAP 1u << 8u #define CURLHELP_HTTP (1u << 8u)
#define CURLHELP_IMPORTANT 1u << 9u #define CURLHELP_IMAP (1u << 9u)
#define CURLHELP_IPFS 1u << 10u #define CURLHELP_IMPORTANT (1u << 10u)
#define CURLHELP_MISC 1u << 11u #define CURLHELP_LDAP (1u << 11u)
#define CURLHELP_OUTPUT 1u << 12u #define CURLHELP_OUTPUT (1u << 12u)
#define CURLHELP_POP3 1u << 13u #define CURLHELP_POP3 (1u << 13u)
#define CURLHELP_POST 1u << 14u #define CURLHELP_POST (1u << 14u)
#define CURLHELP_PROXY 1u << 15u #define CURLHELP_PROXY (1u << 15u)
#define CURLHELP_SCP 1u << 16u #define CURLHELP_SCP (1u << 16u)
#define CURLHELP_SFTP 1u << 17u #define CURLHELP_SFTP (1u << 17u)
#define CURLHELP_SMTP 1u << 18u #define CURLHELP_SMTP (1u << 18u)
#define CURLHELP_SSH 1u << 19u #define CURLHELP_SSH (1u << 19u)
#define CURLHELP_TELNET 1u << 20u #define CURLHELP_TELNET (1u << 20u)
#define CURLHELP_TFTP 1u << 21u #define CURLHELP_TFTP (1u << 21u)
#define CURLHELP_TLS 1u << 22u #define CURLHELP_TIMEOUT (1u << 22u)
#define CURLHELP_UPLOAD 1u << 23u #define CURLHELP_TLS (1u << 23u)
#define CURLHELP_VERBOSE 1u << 24u #define CURLHELP_UPLOAD (1u << 24u)
#define CURLHELP_ECH 1u << 25u #define CURLHELP_VERBOSE (1u << 25u)
#define CURLHELP_ALL (0xfffffffu)
extern const struct helptxt helptext[]; extern const struct helptxt helptext[];

View file

@ -83,10 +83,10 @@ const struct helptxt helptext[] = {
CURLHELP_CURL}, CURLHELP_CURL},
{" --connect-timeout <seconds>", {" --connect-timeout <seconds>",
"Maximum time allowed to connect", "Maximum time allowed to connect",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_TIMEOUT},
{" --connect-to <HOST1:PORT1:HOST2:PORT2>", {" --connect-to <HOST1:PORT1:HOST2:PORT2>",
"Connect to host", "Connect to host2 instead of host1",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_DNS},
{"-C, --continue-at <offset>", {"-C, --continue-at <offset>",
"Resumed transfer offset", "Resumed transfer offset",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
@ -98,7 +98,7 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP}, CURLHELP_HTTP},
{" --create-dirs", {" --create-dirs",
"Create necessary local directory hierarchy", "Create necessary local directory hierarchy",
CURLHELP_CURL | CURLHELP_OUTPUT}, CURLHELP_OUTPUT},
{" --create-file-mode <mode>", {" --create-file-mode <mode>",
"File mode for created files", "File mode for created files",
CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_FILE | CURLHELP_UPLOAD}, CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_FILE | CURLHELP_UPLOAD},
@ -170,10 +170,10 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP | CURLHELP_FTP}, CURLHELP_HTTP | CURLHELP_FTP},
{" --ech <config>", {" --ech <config>",
"Configure ECH", "Configure ECH",
CURLHELP_TLS | CURLHELP_ECH}, CURLHELP_TLS},
{" --egd-file <file>", {" --egd-file <file>",
"EGD socket path for random data", "EGD socket path for random data",
CURLHELP_TLS}, CURLHELP_DEPRECATED},
{" --engine <name>", {" --engine <name>",
"Crypto engine to use", "Crypto engine to use",
CURLHELP_TLS}, CURLHELP_TLS},
@ -185,13 +185,13 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP}, CURLHELP_HTTP},
{" --expect100-timeout <seconds>", {" --expect100-timeout <seconds>",
"How long to wait for 100-continue", "How long to wait for 100-continue",
CURLHELP_HTTP}, CURLHELP_HTTP | CURLHELP_TIMEOUT},
{"-f, --fail", {"-f, --fail",
"Fail fast with no output on HTTP errors", "Fail fast with no output on HTTP errors",
CURLHELP_IMPORTANT | CURLHELP_HTTP}, CURLHELP_IMPORTANT | CURLHELP_HTTP},
{" --fail-early", {" --fail-early",
"Fail on first transfer error", "Fail on first transfer error",
CURLHELP_CURL}, CURLHELP_CURL | CURLHELP_GLOBAL},
{" --fail-with-body", {" --fail-with-body",
"Fail on HTTP errors but save the body", "Fail on HTTP errors but save the body",
CURLHELP_HTTP | CURLHELP_OUTPUT}, CURLHELP_HTTP | CURLHELP_OUTPUT},
@ -200,13 +200,15 @@ const struct helptxt helptext[] = {
CURLHELP_TLS}, CURLHELP_TLS},
{"-F, --form <name=content>", {"-F, --form <name=content>",
"Specify multipart MIME data", "Specify multipart MIME data",
CURLHELP_HTTP | CURLHELP_UPLOAD}, CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST | CURLHELP_IMAP |
CURLHELP_SMTP},
{" --form-escape", {" --form-escape",
"Escape form fields using backslash", "Escape form fields using backslash",
CURLHELP_HTTP | CURLHELP_UPLOAD}, CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST},
{" --form-string <name=string>", {" --form-string <name=string>",
"Specify multipart MIME data", "Specify multipart MIME data",
CURLHELP_HTTP | CURLHELP_UPLOAD}, CURLHELP_HTTP | CURLHELP_UPLOAD | CURLHELP_POST | CURLHELP_SMTP |
CURLHELP_IMAP},
{" --ftp-account <data>", {" --ftp-account <data>",
"Account data string", "Account data string",
CURLHELP_FTP | CURLHELP_AUTH}, CURLHELP_FTP | CURLHELP_AUTH},
@ -215,7 +217,7 @@ const struct helptxt helptext[] = {
CURLHELP_FTP}, CURLHELP_FTP},
{" --ftp-create-dirs", {" --ftp-create-dirs",
"Create the remote dirs if not present", "Create the remote dirs if not present",
CURLHELP_FTP | CURLHELP_SFTP | CURLHELP_CURL}, CURLHELP_FTP | CURLHELP_SFTP},
{" --ftp-method <method>", {" --ftp-method <method>",
"Control CWD usage", "Control CWD usage",
CURLHELP_FTP}, CURLHELP_FTP},
@ -242,13 +244,13 @@ const struct helptxt helptext[] = {
CURLHELP_FTP | CURLHELP_TLS}, CURLHELP_FTP | CURLHELP_TLS},
{"-G, --get", {"-G, --get",
"Put the post data in the URL and use GET", "Put the post data in the URL and use GET",
CURLHELP_HTTP | CURLHELP_UPLOAD}, CURLHELP_HTTP},
{"-g, --globoff", {"-g, --globoff",
"Disable URL globbing with {} and []", "Disable URL globbing with {} and []",
CURLHELP_CURL}, CURLHELP_CURL},
{" --happy-eyeballs-timeout-ms <ms>", {" --happy-eyeballs-timeout-ms <ms>",
"Time for IPv6 before IPv4", "Time for IPv6 before IPv4",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_TIMEOUT},
{" --haproxy-clientip <ip>", {" --haproxy-clientip <ip>",
"Set address in HAProxy PROXY", "Set address in HAProxy PROXY",
CURLHELP_HTTP | CURLHELP_PROXY}, CURLHELP_HTTP | CURLHELP_PROXY},
@ -311,7 +313,7 @@ const struct helptxt helptext[] = {
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
{" --ipfs-gateway <URL>", {" --ipfs-gateway <URL>",
"Gateway for IPFS", "Gateway for IPFS",
CURLHELP_IPFS}, CURLHELP_CURL},
{"-4, --ipv4", {"-4, --ipv4",
"Resolve names to IPv4 addresses", "Resolve names to IPv4 addresses",
CURLHELP_CONNECTION | CURLHELP_DNS}, CURLHELP_CONNECTION | CURLHELP_DNS},
@ -329,7 +331,7 @@ const struct helptxt helptext[] = {
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
{" --keepalive-time <seconds>", {" --keepalive-time <seconds>",
"Interval time for keepalive probes", "Interval time for keepalive probes",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_TIMEOUT},
{" --key <key>", {" --key <key>",
"Private key filename", "Private key filename",
CURLHELP_TLS | CURLHELP_SSH}, CURLHELP_TLS | CURLHELP_SSH},
@ -341,7 +343,7 @@ const struct helptxt helptext[] = {
CURLHELP_FTP}, CURLHELP_FTP},
{" --libcurl <file>", {" --libcurl <file>",
"Generate libcurl code for this command line", "Generate libcurl code for this command line",
CURLHELP_CURL}, CURLHELP_CURL | CURLHELP_GLOBAL},
{" --limit-rate <speed>", {" --limit-rate <speed>",
"Limit transfer speed to RATE", "Limit transfer speed to RATE",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
@ -359,7 +361,8 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP | CURLHELP_AUTH}, CURLHELP_HTTP | CURLHELP_AUTH},
{" --login-options <options>", {" --login-options <options>",
"Server login options", "Server login options",
CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | CURLHELP_AUTH}, CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP | CURLHELP_AUTH |
CURLHELP_LDAP},
{" --mail-auth <address>", {" --mail-auth <address>",
"Originator address of the original email", "Originator address of the original email",
CURLHELP_SMTP}, CURLHELP_SMTP},
@ -383,10 +386,10 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP}, CURLHELP_HTTP},
{"-m, --max-time <seconds>", {"-m, --max-time <seconds>",
"Maximum time allowed for transfer", "Maximum time allowed for transfer",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_TIMEOUT},
{" --metalink", {" --metalink",
"Process given URLs as metalink XML file", "Process given URLs as metalink XML file",
CURLHELP_MISC}, CURLHELP_DEPRECATED},
{" --mptcp", {" --mptcp",
"Enable Multipath TCP", "Enable Multipath TCP",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
@ -395,13 +398,13 @@ const struct helptxt helptext[] = {
CURLHELP_AUTH | CURLHELP_HTTP}, CURLHELP_AUTH | CURLHELP_HTTP},
{"-n, --netrc", {"-n, --netrc",
"Must read .netrc for username and password", "Must read .netrc for username and password",
CURLHELP_CURL}, CURLHELP_AUTH},
{" --netrc-file <filename>", {" --netrc-file <filename>",
"Specify FILE for netrc", "Specify FILE for netrc",
CURLHELP_CURL}, CURLHELP_AUTH},
{" --netrc-optional", {" --netrc-optional",
"Use either .netrc or URL", "Use either .netrc or URL",
CURLHELP_CURL}, CURLHELP_AUTH},
{"-:, --next", {"-:, --next",
"Make next URL use separate options", "Make next URL use separate options",
CURLHELP_CURL}, CURLHELP_CURL},
@ -410,10 +413,10 @@ const struct helptxt helptext[] = {
CURLHELP_TLS | CURLHELP_HTTP}, CURLHELP_TLS | CURLHELP_HTTP},
{"-N, --no-buffer", {"-N, --no-buffer",
"Disable buffering of the output stream", "Disable buffering of the output stream",
CURLHELP_CURL}, CURLHELP_OUTPUT},
{" --no-clobber", {" --no-clobber",
"Do not overwrite files that already exist", "Do not overwrite files that already exist",
CURLHELP_CURL | CURLHELP_OUTPUT}, CURLHELP_OUTPUT},
{" --no-keepalive", {" --no-keepalive",
"Disable TCP keepalive on the connection", "Disable TCP keepalive on the connection",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
@ -434,25 +437,26 @@ const struct helptxt helptext[] = {
CURLHELP_AUTH | CURLHELP_HTTP}, CURLHELP_AUTH | CURLHELP_HTTP},
{" --ntlm-wb", {" --ntlm-wb",
"HTTP NTLM authentication with winbind", "HTTP NTLM authentication with winbind",
CURLHELP_AUTH | CURLHELP_HTTP}, CURLHELP_DEPRECATED},
{" --oauth2-bearer <token>", {" --oauth2-bearer <token>",
"OAuth 2 Bearer Token", "OAuth 2 Bearer Token",
CURLHELP_AUTH}, CURLHELP_AUTH | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP |
CURLHELP_LDAP},
{"-o, --output <file>", {"-o, --output <file>",
"Write to file instead of stdout", "Write to file instead of stdout",
CURLHELP_IMPORTANT | CURLHELP_CURL | CURLHELP_OUTPUT}, CURLHELP_IMPORTANT | CURLHELP_OUTPUT},
{" --output-dir <dir>", {" --output-dir <dir>",
"Directory to save files in", "Directory to save files in",
CURLHELP_CURL | CURLHELP_OUTPUT}, CURLHELP_OUTPUT},
{"-Z, --parallel", {"-Z, --parallel",
"Perform transfers in parallel", "Perform transfers in parallel",
CURLHELP_CONNECTION | CURLHELP_CURL}, CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL},
{" --parallel-immediate", {" --parallel-immediate",
"Do not wait for multiplexing", "Do not wait for multiplexing",
CURLHELP_CONNECTION | CURLHELP_CURL}, CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL},
{" --parallel-max <num>", {" --parallel-max <num>",
"Maximum concurrency for parallel transfers", "Maximum concurrency for parallel transfers",
CURLHELP_CONNECTION | CURLHELP_CURL}, CURLHELP_CONNECTION | CURLHELP_CURL | CURLHELP_GLOBAL},
{" --pass <phrase>", {" --pass <phrase>",
"Passphrase for the private key", "Passphrase for the private key",
CURLHELP_SSH | CURLHELP_TLS | CURLHELP_AUTH}, CURLHELP_SSH | CURLHELP_TLS | CURLHELP_AUTH},
@ -476,7 +480,7 @@ const struct helptxt helptext[] = {
CURLHELP_PROXY}, CURLHELP_PROXY},
{"-#, --progress-bar", {"-#, --progress-bar",
"Display transfer progress as a bar", "Display transfer progress as a bar",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --proto <protocols>", {" --proto <protocols>",
"Enable/disable PROTOCOLS", "Enable/disable PROTOCOLS",
CURLHELP_CONNECTION | CURLHELP_CURL}, CURLHELP_CONNECTION | CURLHELP_CURL},
@ -587,13 +591,13 @@ const struct helptxt helptext[] = {
CURLHELP_FTP | CURLHELP_SFTP}, CURLHELP_FTP | CURLHELP_SFTP},
{" --random-file <file>", {" --random-file <file>",
"File for reading random data from", "File for reading random data from",
CURLHELP_MISC}, CURLHELP_DEPRECATED},
{"-r, --range <range>", {"-r, --range <range>",
"Retrieve only the bytes within RANGE", "Retrieve only the bytes within RANGE",
CURLHELP_HTTP | CURLHELP_FTP | CURLHELP_SFTP | CURLHELP_FILE}, CURLHELP_HTTP | CURLHELP_FTP | CURLHELP_SFTP | CURLHELP_FILE},
{" --rate <max request rate>", {" --rate <max request rate>",
"Request rate for serial transfers", "Request rate for serial transfers",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_GLOBAL},
{" --raw", {" --raw",
"Do HTTP raw; no transfer decoding", "Do HTTP raw; no transfer decoding",
CURLHELP_HTTP}, CURLHELP_HTTP},
@ -614,10 +618,11 @@ const struct helptxt helptext[] = {
CURLHELP_OUTPUT}, CURLHELP_OUTPUT},
{" --remove-on-error", {" --remove-on-error",
"Remove output file on errors", "Remove output file on errors",
CURLHELP_CURL | CURLHELP_OUTPUT}, CURLHELP_OUTPUT},
{"-X, --request <method>", {"-X, --request <method>",
"Specify request method to use", "Specify request method to use",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_POP3 | CURLHELP_FTP | CURLHELP_IMAP |
CURLHELP_SMTP},
{" --request-target <path>", {" --request-target <path>",
"Specify the target for this request", "Specify the target for this request",
CURLHELP_HTTP}, CURLHELP_HTTP},
@ -635,10 +640,10 @@ const struct helptxt helptext[] = {
CURLHELP_CURL}, CURLHELP_CURL},
{" --retry-delay <seconds>", {" --retry-delay <seconds>",
"Wait time between retries", "Wait time between retries",
CURLHELP_CURL}, CURLHELP_CURL | CURLHELP_TIMEOUT},
{" --retry-max-time <seconds>", {" --retry-max-time <seconds>",
"Retry only within this period", "Retry only within this period",
CURLHELP_CURL}, CURLHELP_CURL | CURLHELP_TIMEOUT},
{" --sasl-authzid <identity>", {" --sasl-authzid <identity>",
"Identity for SASL PLAIN authentication", "Identity for SASL PLAIN authentication",
CURLHELP_AUTH}, CURLHELP_AUTH},
@ -647,10 +652,10 @@ const struct helptxt helptext[] = {
CURLHELP_AUTH}, CURLHELP_AUTH},
{" --service-name <name>", {" --service-name <name>",
"SPNEGO service name", "SPNEGO service name",
CURLHELP_MISC}, CURLHELP_AUTH},
{"-S, --show-error", {"-S, --show-error",
"Show error even when -s is used", "Show error even when -s is used",
CURLHELP_CURL}, CURLHELP_CURL | CURLHELP_GLOBAL},
{"-s, --silent", {"-s, --silent",
"Silent mode", "Silent mode",
CURLHELP_IMPORTANT | CURLHELP_VERBOSE}, CURLHELP_IMPORTANT | CURLHELP_VERBOSE},
@ -683,10 +688,11 @@ const struct helptxt helptext[] = {
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
{"-y, --speed-time <seconds>", {"-y, --speed-time <seconds>",
"Trigger 'speed-limit' abort after this time", "Trigger 'speed-limit' abort after this time",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION | CURLHELP_TIMEOUT},
{" --ssl", {" --ssl",
"Try enabling TLS", "Try enabling TLS",
CURLHELP_TLS}, CURLHELP_TLS | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP |
CURLHELP_LDAP},
{" --ssl-allow-beast", {" --ssl-allow-beast",
"Allow security flaw to improve interop", "Allow security flaw to improve interop",
CURLHELP_TLS}, CURLHELP_TLS},
@ -698,7 +704,8 @@ const struct helptxt helptext[] = {
CURLHELP_TLS}, CURLHELP_TLS},
{" --ssl-reqd", {" --ssl-reqd",
"Require SSL/TLS", "Require SSL/TLS",
CURLHELP_TLS}, CURLHELP_TLS | CURLHELP_IMAP | CURLHELP_POP3 | CURLHELP_SMTP |
CURLHELP_LDAP},
{" --ssl-revoke-best-effort", {" --ssl-revoke-best-effort",
"Ignore missing cert CRL dist points", "Ignore missing cert CRL dist points",
CURLHELP_TLS}, CURLHELP_TLS},
@ -710,10 +717,10 @@ const struct helptxt helptext[] = {
CURLHELP_TLS}, CURLHELP_TLS},
{" --stderr <file>", {" --stderr <file>",
"Where to redirect stderr", "Where to redirect stderr",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --styled-output", {" --styled-output",
"Enable styled output for HTTP headers", "Enable styled output for HTTP headers",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --suppress-connect-headers", {" --suppress-connect-headers",
"Suppress proxy CONNECT response headers", "Suppress proxy CONNECT response headers",
CURLHELP_PROXY}, CURLHELP_PROXY},
@ -770,19 +777,19 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP}, CURLHELP_HTTP},
{" --trace <file>", {" --trace <file>",
"Write a debug trace to FILE", "Write a debug trace to FILE",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --trace-ascii <file>", {" --trace-ascii <file>",
"Like --trace, but without hex output", "Like --trace, but without hex output",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --trace-config <string>", {" --trace-config <string>",
"Details to log in trace/verbose output", "Details to log in trace/verbose output",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --trace-ids", {" --trace-ids",
"Transfer + connection ids in verbose output", "Transfer + connection ids in verbose output",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --trace-time", {" --trace-time",
"Add time stamps to trace/verbose output", "Add time stamps to trace/verbose output",
CURLHELP_VERBOSE}, CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{" --unix-socket <path>", {" --unix-socket <path>",
"Connect through this Unix domain socket", "Connect through this Unix domain socket",
CURLHELP_CONNECTION}, CURLHELP_CONNECTION},
@ -797,7 +804,7 @@ const struct helptxt helptext[] = {
CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD}, CURLHELP_HTTP | CURLHELP_POST | CURLHELP_UPLOAD},
{"-B, --use-ascii", {"-B, --use-ascii",
"Use ASCII/text transfer", "Use ASCII/text transfer",
CURLHELP_MISC}, CURLHELP_FTP | CURLHELP_OUTPUT | CURLHELP_LDAP},
{"-u, --user <user:password>", {"-u, --user <user:password>",
"Server user and password", "Server user and password",
CURLHELP_IMPORTANT | CURLHELP_AUTH}, CURLHELP_IMPORTANT | CURLHELP_AUTH},
@ -809,7 +816,7 @@ const struct helptxt helptext[] = {
CURLHELP_CURL}, CURLHELP_CURL},
{"-v, --verbose", {"-v, --verbose",
"Make the operation more talkative", "Make the operation more talkative",
CURLHELP_IMPORTANT | CURLHELP_VERBOSE}, CURLHELP_IMPORTANT | CURLHELP_VERBOSE | CURLHELP_GLOBAL},
{"-V, --version", {"-V, --version",
"Show version number and quit", "Show version number and quit",
CURLHELP_IMPORTANT | CURLHELP_CURL}, CURLHELP_IMPORTANT | CURLHELP_CURL},
@ -821,6 +828,6 @@ const struct helptxt helptext[] = {
CURLHELP_VERBOSE}, CURLHELP_VERBOSE},
{" --xattr", {" --xattr",
"Store metadata in extended file attributes", "Store metadata in extended file attributes",
CURLHELP_MISC}, CURLHELP_OUTPUT},
{ NULL, NULL, CURLHELP_HIDDEN } { NULL, NULL, 0 }
}; };

View file

@ -32,31 +32,33 @@ curl invalid category --help
</errorcode> </errorcode>
<stdout mode="text"> <stdout mode="text">
Usage: curl [options...] <url> Usage: curl [options...] <url>
Invalid category provided, here is a list of all categories: Unknown category provided, here is a list of all categories:
auth Different types of authentication methods auth Authentication methods
connection Low level networking operations connection Manage connections
curl The command line tool itself curl The command line tool itself
dns General DNS options deprecated Legacy
file FILE protocol options dns Names and resolving
ftp FTP protocol options file FILE protocol
http HTTP and HTTPS protocol options ftp FTP protocol
imap IMAP protocol options global Global options
misc Options that do not fit into any other category http HTTP and HTTPS protocol
imap IMAP protocol
ldap LDAP protocol
output Filesystem output output Filesystem output
pop3 POP3 protocol options pop3 POP3 protocol
post HTTP Post specific options post HTTP POST specific
proxy All options related to proxies proxy Options for proxies
scp SCP protocol options scp SCP protocol
sftp SFTP protocol options sftp SFTP protocol
smtp SMTP protocol options smtp SMTP protocol
ssh SSH protocol options ssh SSH protocol
telnet TELNET protocol options telnet TELNET protocol
tftp TFTP protocol options tftp TFTP protocol
tls All TLS/SSL related options timeout Timeouts and delays
ech All Encrypted Client Hello (ECH) options tls TLS/SSL related
upload All options for uploads upload Upload, sending data
verbose Options related to any kind of command line output of curl verbose Tracing, logging etc
</stdout> </stdout>
</verify> </verify>
</testcase> </testcase>

View file

@ -36,7 +36,7 @@ curl file category --help
</errorcode> </errorcode>
<stdout mode="text"> <stdout mode="text">
Usage: curl [options...] <url> Usage: curl [options...] <url>
file: FILE protocol options file: FILE protocol
--create-file-mode <mode> File mode for created files --create-file-mode <mode> File mode for created files
-I, --head Show document info only -I, --head Show document info only
-l, --list-only List only mode -l, --list-only List only mode

View file

@ -36,7 +36,7 @@ curl file category --help with lower/upper mix
</errorcode> </errorcode>
<stdout mode="text"> <stdout mode="text">
Usage: curl [options...] <url> Usage: curl [options...] <url>
file: FILE protocol options file: FILE protocol
--create-file-mode <mode> File mode for created files --create-file-mode <mode> File mode for created files
-I, --head Show document info only -I, --head Show document info only
-l, --list-only List only mode -l, --list-only List only mode

View file

@ -45,7 +45,7 @@ Short: v
Long: fakeitreal Long: fakeitreal
Mutexed: trace trace-ascii Mutexed: trace trace-ascii
Help: Make the operation more talkative Help: Make the operation more talkative
Category: important verbose Category: important verbose global
Added: 4.0 Added: 4.0
Multi: boolean Multi: boolean
Scope: global Scope: global

View file

@ -45,7 +45,7 @@ Short: v
Long: fakeitreal Long: fakeitreal
Mutexed: trace trace-ascii Mutexed: trace trace-ascii
Help: Make the operation more talkative Help: Make the operation more talkative
Category: important verbose Category: important verbose global
Added: 4.0 Added: 4.0
Multi: boolean Multi: boolean
Scope: global Scope: global