Skip to content
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

Merged
merged 1 commit into from
Jun 17, 2024
Merged

Conversation

scop
Copy link
Owner

@scop scop commented Jun 7, 2024

completions/_sops Show resolved Hide resolved
@@ -0,0 +1,24 @@
# 3rd party completion loader for commands using -*- shell-script -*-
# version 1 of the https://cli.urfave.org library.
Copy link
Owner Author

@scop scop Jun 7, 2024

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.

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.

Comment on lines +21 to +22
complete -o bashdefault -o default -o nospace \
-F _comp_cmd__urfave_cli_v1 "$1"
Copy link
Owner Author

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.

@scop scop force-pushed the feat/3rdparty-sops branch from c66f407 to bbf9088 Compare June 7, 2024 04:26
@scop
Copy link
Owner Author

scop commented Jun 7, 2024

Added upstream FYI discussion at urfave/cli#1922

Copy link
Collaborator

@akinomyoga akinomyoga left a 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.

@scop scop merged commit 47af482 into main Jun 17, 2024
7 checks passed
@scop scop deleted the feat/3rdparty-sops branch June 17, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants