Skip to content

curl: fix option listing in newer versions #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion completions/curl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ _comp_cmd_curl()
esac

if [[ $cur == -* ]]; then
COMPREPLY=($(compgen -W '$(_parse_help "$1" --help all)' -- "$cur"))
COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help all")' -- "$cur"))
[[ ${COMPREPLY-} ]] ||
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
fi
Expand Down
12 changes: 12 additions & 0 deletions test/t/test_curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ def test_data_atfile_dir(self, completion):
def test_unknown_option(self, completion):
# Just see that it does not error out
pass

@pytest.mark.complete("curl --data-bina", require_cmd=True)
def test_help_all_option(self, completion):
"""
The option used as a canary here is one that should be available
in all curl versions. It should be only listed in `--help all` output
for curl versions that have their help output split to multiple
categories (i.e. ones that support `--help all` to get the complete
list), as well as the basic `--help` output for earlier versions that
do not have that.
"""
assert completion