Skip to content
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

Some complete usability improvements #7321

Closed
wants to merge 5 commits into from

Conversation

faho
Copy link
Member

@faho faho commented Sep 9, 2020

Description

This fixes a few of completes usage warts.

  • It's weird to always have -c command as the first two arguments. This makes the -c optional, if there is one non-option argument it's used as the command
  • complete -c command without any other options now lists just the (loaded) completions for that command
  • Some improvements to the docs

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

Currently only `complete` will list completions, and it will list all
of them.

That's a bit ridiculous, especially since `complete -c foo` just does nothing.

So just make `complete -c foo` list all the completions for `foo`.
Currently, completions have to be specified like

```fish
complete -c foo -l opt
```

while

```fish
complete foo -l opt
```

just complains about there being too many arguments.

That's kinda useless, so we just assume if there is one left-over
argument that it's meant to be the command.

Theoretically we could also use *all* the arguments as commands to
complete, but that seems unlikely to be what the user wants.

(I don't think multi-command completions really happen)
These have been removed for ages, the complete docs are too verbose as
it is.
A bit stuffy, some weird bits (I don't think GNU-style long options
can typically be abbreviated, ``true --v`` and ``bash --hel`` don't work).
@faho faho added this to the fish 3.2.0 milestone Sep 9, 2020
@faho
Copy link
Member Author

faho commented Sep 9, 2020

Merged as a8e237f..624d0b7

@faho faho closed this Sep 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant