-
Notifications
You must be signed in to change notification settings - Fork 383
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(sops): add 3rd party fallback completion loader #1211
Conversation
@@ -0,0 +1,24 @@ | |||
# 3rd party completion loader for commands using -*- shell-script -*- | |||
# version 1 of the https://cli.urfave.org library. |
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.
Not sure if there are substantial differences at the moment in the v1 vs v2 completions at the moment, but I initially looked into using the upstream main branch one as a template for sops
and didn't get it to work immediately, so thought we might want to add one for each version. That'll mean some more maintenance when tools upgrade their urfave/cli though, and it'd be great if we could use the same for all despite the branch.
- v1: https://github.com/urfave/cli/blob/v1-maint/autocomplete/bash_autocomplete
- v2: https://github.com/urfave/cli/blob/v2-maint/autocomplete/bash_autocomplete
- to-be v3: https://github.com/urfave/cli/blob/main/autocomplete/bash_autocomplete
urfave/cli upstream, if you're reading this, your comments regarding whether the same autoloader code is intended to work between library major versions would be appreciated.
complete -o bashdefault -o default -o nospace \ | ||
-F _comp_cmd__urfave_cli_v1 "$1" |
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.
Followed upstream in the use of various -o
. Notably nospace
does not seem to work that well at least with sops
, but I don't know if we want to "fix" it and deviate from upstream on this.
Added upstream FYI discussion at urfave/cli#1922 |
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'm not familiar with the upstream framework, but as they seem to have left 👍 , I think this should be fine.
https://github.com/getsops/sops