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

gwhisper binary returning completion script #105

Open
ericboehmler opened this issue Jun 22, 2021 · 1 comment
Open

gwhisper binary returning completion script #105

ericboehmler opened this issue Jun 22, 2021 · 1 comment

Comments

@ericboehmler
Copy link
Member

ericboehmler commented Jun 22, 2021

Is your feature request related to a problem? Please describe.
The CLI gh for github is having a nice feature. Called with a given parameter it is returning the completion script to the shell. This then can be evaluated into the bashrc or else. This makes changes in the completion script painless between version changes.

Describe the solution you'd like
something like this:

gwhisper --completion=bash
returning the content of `complete.bash`

Then bashrc can evaluate it like this:

eval "$(gwhisper --completion=bash)"

Describe alternatives you've considered

Describe why you think this feature is useful for gWhisper users
Changes in autocompletion are automatically reflected when the new version returns its respective completion script.

Additional context

@rainerschoe
Copy link
Member

I think this is a good idea, however I do not yet completely understand the huge benefit of this approach in case of gWhisper:

The complete.bash file is basically only containing a redirection to gwhisper to return the actual completions. So it is very light weight.
Since the initial open source release of gWhisper there was not a single change to those completion scripts.

It would be nice if shells would automatically have a standard way of querying a program for completions, but neither bash nor fish is doing this, so a complete.fish or complete.bash will still be needed and installed with this approach (with only one line though).

I think I will postpone this until the next change to those completion scripts is made and then implement it like you proposed.

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

No branches or pull requests

2 participants