fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2 3# Helper function for contextual autocompletion of GPG key ids 4function __fish_complete_gpg_key_id -d'Complete using gpg key ids' -a __fish_complete_gpg_command list_arg 5# Use user id as description 6set -l keyid 7set -q list_arg[ 1 ] ;or set list_arg --list-keys 8$__fish_complete_gpg_command $list_arg --with-colons| while read -l garbage 9switch $garbage 10case "uid*" 11# Extract user ids (note: gpg escapes colons as '\x3a') 12set -l __uid( string split":" --$garbage ) 13set -l uid( string replace -a'\x3a' ':' --$__uid [ 10 ]) 14printf "%s\t%s\n" $keyid $uid 15# NOTE key is preceded by "sec" instead of "pub" when listing secret keys 16case "pub*" "sec*" 17# Extract key fingerprints (no subkeys) 18set -l __pub( string split":" --$garbage ) 19set keyid$__pub [ 5 ] 20end 21end 22end