1
0
mirror of https://github.com/moparisthebest/curl synced 2024-10-31 15:45:12 -04:00

zsh.pl: produce a working completion script again

Commit curl-7_54_0-118-g8b2f22e changed the output format of curl --help
to use <file> and <dir> instead of FILE and DIR, which caused zsh.pl to
produce a broken completion script:

% curl --<TAB>
_curl:10: no such file or directory: seconds

Closes #1779
This commit is contained in:
Kamil Dudka 2017-08-14 16:13:32 +02:00
parent 9bd2248f92
commit ab2a7079cd
3 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
Long: cacert Long: cacert
Arg: <CA certificate> Arg: <file>
Help: CA certificate to verify peer against Help: CA certificate to verify peer against
Protocols: TLS Protocols: TLS
--- ---

View File

@ -54,10 +54,11 @@ sub parse_main_opts {
$option .= '}' if defined $short; $option .= '}' if defined $short;
$option .= '\'[' . trim($desc) . ']\'' if defined $desc; $option .= '\'[' . trim($desc) . ']\'' if defined $desc;
$option .= ":$arg" if defined $arg; $option .= ":'$arg'" if defined $arg;
$option .= ':_files' $option .= ':_files'
if defined $arg and ($arg eq 'FILE' || $arg eq 'DIR'); if defined $arg and ($arg eq '<file>' || $arg eq '<filename>'
|| $arg eq '<dir>');
push @list, $option; push @list, $option;
} }

View File

@ -54,7 +54,7 @@ static const struct helptxt helptext[] = {
"Append to target file when uploading"}, "Append to target file when uploading"},
{" --basic", {" --basic",
"Use HTTP Basic Authentication"}, "Use HTTP Basic Authentication"},
{" --cacert <CA certificate>", {" --cacert <file>",
"CA certificate to verify peer against"}, "CA certificate to verify peer against"},
{" --capath <dir>", {" --capath <dir>",
"CA directory to verify peer against"}, "CA directory to verify peer against"},