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

Fish completion support #122

Merged
merged 2 commits into from May 21, 2018
Merged

Fish completion support #122

merged 2 commits into from May 21, 2018

Conversation

Ellmen
Copy link
Contributor

@Ellmen Ellmen commented May 17, 2018

Re: #56

This adds support for completions for the fish shell. It adds an optional argument to the --completions flag to specify a shell to create completions for.

Usage looks like:
widget -- --completion or widget -- --completion bash
for bash completions or
widget -- --completion fish
for fish completions

@dbieber
Copy link
Member

dbieber commented May 21, 2018

Thanks for this contribution!
Props for your thoroughness with docs and tests :)

@dbieber dbieber merged commit 83a8036 into google:master May 21, 2018
@dbieber
Copy link
Member

dbieber commented May 21, 2018

Looking forward, we'd eventually like to replace our use of argparse in parser.py with fire.

When we do so, "completion" will become an argument of a function with default value 'None'. At that point '--completion' will be treated as True, '--completion bash' will be 'bash', and '--completion fish' will be 'fish'. So, like in your code, we'll treat True as 'bash'.

@Ellmen
Copy link
Contributor Author

Ellmen commented May 21, 2018

Happy to help! Sounds good - it should be relatively easy to add zsh support the same way

@dbieber
Copy link
Member

dbieber commented May 21, 2018

That would be great -- #64 requests it.
I also welcome you to read the doc in #32 (here) and let me know if you have thoughts on this or want to work on it. It's a proposal to eliminate individual per-CLI completion scripts in favor of a single completion script for all Fire CLIs.

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

Successfully merging this pull request may close these issues.

None yet

2 participants