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

Generate completions for fish shell #2927

Closed
reitzig opened this issue May 31, 2024 · 6 comments · Fixed by #2929
Closed

Generate completions for fish shell #2927

reitzig opened this issue May 31, 2024 · 6 comments · Fixed by #2929
Labels
enhancement New feature or request

Comments

@reitzig
Copy link

reitzig commented May 31, 2024

Feature Overview

aqua completion should support argument fish, outputting fish code that can be sourced or written to a completion file.

Why is the feature needed?

fish is a popular shell in some circles.

Workaround

There is no workaround: bash/zsh completion is utterly incompatible with the fish way of doing completions.

Example Code

$ aqua completion fish | source

should enable fish completion in the current shell.

Note

While undocumented, urface/cli seems to implement fish completions: urfave/cli#351, urfave/cli#848, smallstep/cli#708

@reitzig reitzig added the enhancement New feature or request label May 31, 2024
@suzuki-shunsuke suzuki-shunsuke moved this to Todo in main May 31, 2024
@suzuki-shunsuke
Copy link
Member

@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented May 31, 2024

I've confirmed the completion works on my laptop.

@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented May 31, 2024

I published the prerelease version v2.29.0-1.

https://github.com/aquaproj/aqua/releases/tag/v2.29.0-1

Could you try v2.29.0-1?

aqua upa v2.29.0-1

@reitzig
Copy link
Author

reitzig commented May 31, 2024

Can confirm: The command generates a valid fish script (tested with fish 3.10, rather old 🙈) that provides (some) completions:
image

Completion doesn't seem to be perfect (note the suggested folder which I think shouldn't be there):
image
Whether that's a problem with the library, or with your use of it, I couldn't say.

In fact, on an empty prompt the valid commands are rather hidden:
image
Expected would be something like this:
image
Most of the Go tools I've installed seem to use spf13/viper so maybe I'm just spoiled. 😅

Anyway, thanks for the lightning-fast resolution, much appreciated! 👏 🫶

@suzuki-shunsuke
Copy link
Member

Thank you for confirming!

@github-project-automation github-project-automation bot moved this from Todo to Done in main May 31, 2024
@suzuki-shunsuke
Copy link
Member

v2.29.0 is out 🎉

https://github.com/aquaproj/aqua/releases/tag/v2.29.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants