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
gpg.fish refactor #6139
gpg.fish refactor #6139
Conversation
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.
As a general overview, I don't think this is the right approach - there is lots of duplicated code which I think could be simplified.
I wonder about:
- breaking gpg2 completions out into
__fish_complete_gpg2
, which takes a__fish_complete_gpg2_command
argument, and which uses$__fish_complete_gpg2_command
instead ofgpg2
everywhere (in functions and completion arguments - in
gpg2.fish
, call__fish_complete_gpg_command gpg2
- in
gpg.fish
, check ifgpg
is 2.x, and if so call__fish_complete_gpg2 gpg
; otherwise use the gpg1 completions
Would that work?
Revert "gut gpg.fish/gpg1.fish/gpg2.fish; migrate functionality to __fish_complete_gpg.fish" This reverts commit d558218. Revert "break version-specific completions out into independent function;" This reverts commit 9160e77. Revert "split gpg2- and gpg1-specific completions to conditional block" This reverts commit a069b95.
I merged this but then saw the comments, so reverted the merge. |
@ridiculousfish: Yeah, sorry-- I implemented @zanchey's idea for deduplicating redundant completion code and decided to see if I could take it a little further. It's not ready yet, since I haven't had time to work on it lately. |
I've rewritten the PR to deduplicate redundant code to the fullest extent possible. The contextual completion functions, along with the GPG completions themselves, have been moved to `share/fish/functions/`. This allows `__fish_complete_gpg` to be called from the actual completion files to conditionally generate completions from the GnuPG version and argument given. This also allows completions for `gpg1` (as in, a binary called `gpg1`) to be easily generated, without adding redundant completion code. Some commenting is required but I'm otherwise done.
…On Sun, Oct 6, 2019 at 19:36, ridiculousfish ***@***.***> wrote:
I merged this but then saw the comments, so reverted the merge.505793
—
You are receiving this because you authored the thread.
Reply to this email directly, [view it on GitHub](#6139?email_source=notifications&email_token=AB7UAJG2MOEU5BTEOI4ORR3QNI423A5CNFSM4I2FWOMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAOSEHY#issuecomment-538780191), or [mute the thread](https://github.com/notifications/unsubscribe-auth/AB7UAJCX5RSPUC6QASKLKK3QNI423ANCNFSM4I2FWOMA).
|
note zanchey is on vacation so this may sit a while. If you are keen to have this merged before their return let me know. |
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.
Looks great; one comment-related change but otherwise good to go.
Merged as 21a6a19, thanks for all the work! |
Thanks for merging @krobelus, I was hoping to get to this today. |
Description
Refactors
gpg.fish
to conditionally activate completions based ongpg
version, as discussed in #6062:TODOs: