-
Notifications
You must be signed in to change notification settings - Fork 4
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
autocompletions #117
Comments
@cgsdev0 assigned 💞 |
@cgsdev0 How does shipping shell completions work? Is it like a man page where you have to put a file in some os-dependent place on disk? (I'm really asking: how does this ticket impact our install process? would we need to integrate with package managers?) |
i don't really know tbh we can try to find some prior art |
got curious, did some digging. shells expect to find a "completion file", which is a shell script that invokes that shell's "complete" builtin a lot of times, in a particular os-specific shell-specific folder. one prior art the cobra library (very fancy go framework for cli tools) adds a command to your CLI which prints a completion file for a given shell:
A user can then run something like this to install the completion:
Their pacakge-manager configurations work the same way, eg Macports another prior art is https://github.com/posener/complete/tree/master, which seems a teensy bit ramshackle (the api is poorly considered, it installs completions to the wrong place, the installed completion prints a stacktrace when I hit tab to execute it) but it does have some cute nuggets:
that second bit is particularly interesting: it suggests that we can, eg, parse a local taskfile with our regular go taskfile parsing to generate completions on-the-fly |
yeah this is the main feature i had in mind i will probably start with just writing the completions file, and then we can worry about how to get it installed 👍 |
sounds cool; lookin' forward to it |
if you assign this to me ill do it
The text was updated successfully, but these errors were encountered: