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

Improved bash completion #557

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

starcraftman
Copy link

Addresses issue #554 that I raised a while ago. Best way to see changes is to test it out I think. Noticeable things:

  • handles --type X & --type=X properly
  • completes basic colors
  • handles '--' expects pattern, then file completion
  • no longer provides completion if command doesn't exist (see 101-103)

One important note, I've retained the parsing of options from --help[-types]. I employ caching so that only first push has a delay. On my slow i3 I barely notice it. Bash unfortunately doesn't have persistent caching like zsh.

If users/others are bothered by the delay, I can modify it to use the fixed strings approach you had before.

I'll also post this to users ML, though doesn't seem to have huge traffic.

* Now parses help instead of embedding fixed strings.x
* Provides relevant specific option completion for
--type, color* & file completion
* Prevents opts after '--'
* No longer completes non-existent commands with have
@petdance
Copy link
Collaborator

@starcraftman Does this PR need to get updated? Or should I merge it now as is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants