mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 16:52:46 +08:00
Stringify gpg completions
This commit is contained in:
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user