aquaproj/aqua

Generate completions for fish shell

reitzig opened this issue ยท 6 comments

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

I've confirmed the completion works on my laptop.

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

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! ๐Ÿ‘ ๐Ÿซถ

Thank you for confirming!