mirror of
https://github.com/fish-shell/fish-shell
synced 2024-09-21 23:11:54 +00:00
fix gpg completion
This commit is contained in:
parent
0814797444
commit
8204d3103b
1 changed files with 12 additions and 2 deletions
|
@ -48,8 +48,18 @@ function __fish_print_gpg_algo -d "Complete using all algorithms of the type spe
|
|||
# will take effect again.
|
||||
set -lx LC_ALL C
|
||||
|
||||
# XXX this misses certain ciphers in gpg --version - redo this entirely and use fish's annoying group printing as a feature finally!
|
||||
gpg --version | __fish_sgrep "$argv:"| __fish_sgrep -v "Home:"|cut -d : -f 2 |tr , \n|tr -d " "
|
||||
# sed script explained:
|
||||
# in the line that matches "$argv:"
|
||||
# define label 'loop'
|
||||
# if the line ends with a ','
|
||||
# add next line to buffer
|
||||
# remove '\n' and following spaces
|
||||
# goto loop
|
||||
# remove everything until the first ':' of the line
|
||||
# remove all blanks
|
||||
# transliterate ',' with '\n' (OSX apparently doesn't like '\n' on RHS of the s-command)
|
||||
# print result
|
||||
gpg --version | sed -ne "/$argv:/"'{:loop; /,$/{N; s!\n[ ]*! !; b loop}; s!^[^:]*:!!; s![ ]*!!g; y!,!\n!; p}'
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue