-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Minimal fish shell completions #524
Conversation
…oes not include flag sub-options like language lists or subcommands
…oes not include flag sub-options like language lists or subcommands
Tested. Basically works. |
Thank you very much for your contribution! My only "concern" with this is that it has to be maintained manually. Most contributors will probably not update the completions files when they change command-line options or change help texts (the same happens with the man page). This means that I have to remind people in the PRs or do it myself when I create a new release. I'm inclined to merge this, but I'm not sure if I will always find the time to keep it up-to-date. |
Oh, before I merge this, we should definitely make sure that the completion file will be added to the release tarballs and Debian packages. See #391 for details. |
bat.fish
Outdated
@@ -0,0 +1,59 @@ | |||
# Fish Shell Completions (WIP) | |||
|
|||
# Place or symlink to $XDG_CONFIG_HOME/fish/completions/bat.fish ($XDG_CONFIG_HOME is usually set to ~/.config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed if we properly install this file?
bat.fish
Outdated
|
||
complete -c bat -s m -l map-syntax -d "<from:to> Map a file extension or file name to an existing syntax" | ||
|
||
# TODO: add completion for theme list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bat --list-themes
does produce a newline-separated list of theme names if it is run in non-interactive mode, i.e. if the output is piped somewhere.
…olor, italic-text, decorations, paging, wrap
…e themes, added cache subcommand completions
I definitely understand the concern regarding future contributor updates @sharkdp, manually written completions would hopefully be a temporary workaround until some future upgrade of the autogeneration piece. Until then, It might be worth adding a note in the readme or a quick CONTRIBUTING.md with some guidelines, I'd add it to this PR but I don't want to impose in that regard. |
I pushed up some minor updates including working I tried getting the completions as part of release packages during testing but I don't have a lot of experience with cargo builds or how to include completions as part of an install for linux/windows (could probably figure out macOS tho if it just involves updating a brew formula or something) |
Thank you very much for the updates! The deployment should hopefully work just like this. |
Can someone from this thread maybe help with actually shipping the fish completions in the Debian package (#554)? Edit: I think I got it. |
Initial Shell Completions
For fish shell only; contains completions for flags but does not include flag sub-options like language lists or subcommands.
From what I understand #482 took place because of bugs with completion autogeneration. I added the 'completions' directory to assets so that perhaps others will follow with ported or manually written bash/zsh completions.