-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
feat: Better ZSH shell completion #38
Comments
I see, interesting. I sort of assumed that shell completion was handled by separate completion scripts, but I guess it makes sense that you use the git-bug executable to handle lookup of the information that zsh etc would need. |
Better ZSH completion landed: https://github.com/MichaelMure/git-bug/tree/master/misc/zsh_completion @Irubataru could you give it a try ? |
Sorry for the late reply, but I finally got around to trying it out and when I try to autocomplete
and if I try to tab complete
I installed it wit the go get method, and placed the |
Ha, interesting. It's possibly because the completion is generated for The bash completion require a very minimal adaptor function: https://github.com/MichaelMure/git-bug/blob/master/commands/root.go#L44-L49 Unfortunately, I have zero knowledge about ZSH completion. Would you be able to fix that ? |
I tried with both I use zsh, but I have never tried to write completion for it. However, if you escape the inner brackets as Also, there is no completion for completing issue numbers. If you look at the zsh file and the bash file, you can see that the bash file has a lot more logic in it. The zsh file only completes command names and optional argument strings. I played around with it for a bit and got something basic working, so maybe I could help out with that if I ever find the time, or is that something your framework should support by itself? |
The situation is that git-bug use Cobra as the command line parser, and this library can generate the ZSH completion. They just landed a complete rewrite of this, so it's possible there is a bug lurking somewhere. The code generating the file is there: https://github.com/spf13/cobra/blob/master/zsh_completions.go As for the custom completion of bug ID, it seems that Cobra doesn't support that at the moment for ZSH: https://github.com/spf13/cobra/blob/master/zsh_completions.md That said, it's very much in line with what they want to support (it's possible for bash). git-bug has the |
The bracket problem is fixed with this PR upstream: spf13/cobra#899 |
This has been working for long. |
To make browsing issues easier it would be really great if we could have shell completion on par with git completion in zsh (not sure how well it works in bash). Ideally typing
git bug show <TAB>
would show a list of bugs similar to howgit checkout <TAB>
shows a list of branches and commits (see picture).The text was updated successfully, but these errors were encountered: