Skip to content

Commit 92ccf03

Browse files
authored
Merge pull request #560 from algorythmic/curl-help-category
fix(curl): fix option listing in newer versions
2 parents 325c888 + d31160c commit 92ccf03

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

completions/curl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ _comp_cmd_curl()
159159
esac
160160

161161
if [[ $cur == -* ]]; then
162-
COMPREPLY=($(compgen -W '$(_parse_help "$1" --help all)' -- "$cur"))
162+
COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help all")' -- "$cur"))
163163
[[ ${COMPREPLY-} ]] ||
164164
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
165165
fi

test/t/test_curl.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ def test_data_atfile_dir(self, completion):
3131
def test_unknown_option(self, completion):
3232
# Just see that it does not error out
3333
pass
34+
35+
@pytest.mark.complete("curl --data-bina", require_cmd=True)
36+
def test_help_all_option(self, completion):
37+
"""
38+
The option used as a canary here is one that should be available
39+
in all curl versions. It should be only listed in `--help all` output
40+
for curl versions that have their help output split to multiple
41+
categories (i.e. ones that support `--help all` to get the complete
42+
list), as well as the basic `--help` output for earlier versions that
43+
do not have that.
44+
"""
45+
assert completion

0 commit comments

Comments
 (0)