mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
Stringify gpg completions
This commit is contained in:
committed by
Fabian Homborg
parent
13a26a1c65
commit
6fb545cf9b
@@ -5,13 +5,15 @@ function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_co
|
||||
set -l keyid
|
||||
$__fish_complete_gpg_command --list-keys --with-colons | while read garbage
|
||||
switch $garbage
|
||||
# Extract user ids
|
||||
# Extract user ids (note: gpg escapes colons as '\x3a')
|
||||
case "uid*"
|
||||
echo $garbage | cut -d ":" -f 10 | sed -e "s/\\\x3a/:/g" | read uid
|
||||
set -l __uid (string split ":" -- $garbage)
|
||||
set uid (string replace -a '\x3a' ':' -- $__uuid[10])
|
||||
printf "%s\t%s\n" $keyid $uid
|
||||
# Extract key fingerprints (no subkeys)
|
||||
# Extract key fingerprints (no subkeys)
|
||||
case "pub*"
|
||||
echo $garbage | cut -d ":" -f 5 | read keyid
|
||||
set -l __pub (string split ":" -- $garbage)
|
||||
set keyid $__pub[5]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user