Skip to content

Commit a4deb37

Browse files
committed
feat(gpg): more key option argument completions
While at it, sort options the same as in the man page.
1 parent b17e9d3 commit a4deb37

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

completions/gpg

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,25 @@ _gpg()
1010
_filedir
1111
return
1212
;;
13-
--export | --sign-key | --lsign-key | --nrsign-key | --nrlsign-key | \
14-
--edit-key | --delete-keys | --delete-secret-and-public-keys | \
15-
--locate-keys | --refresh-keys)
13+
--list-keys | --list-public-keys | --locate-keys | \
14+
--locate-external-keys | --fingerprint | --delete-keys | \
15+
--delete-secret-and-public-keys | --export | --refresh-keys | \
16+
--search-keys | --edit-key | --sign-key | --lsign-key | \
17+
--nrsign-key | --nrlsign-key | --try-secret-key | -!(-*)k)
1618
# return list of public keys
1719
COMPREPLY=($(compgen -W "$($1 --list-keys 2>/dev/null |
1820
command sed -ne \
1921
's@^pub.*/\([^ ]*\).*$@\1@p' -ne \
2022
's@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur"))
2123
return
2224
;;
25+
--list-secret-keys | --delete-secret-keys | --export-secret-keys | \
26+
--export-secret-subkeys | -!(-*)K)
27+
# return list of secret keys
28+
COMPREPLY=($(compgen -W "$($1 --list-secret-keys 2>/dev/null |
29+
command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur"))
30+
return
31+
;;
2332
--recipient | -!(-*)r)
2433
COMPREPLY=($(compgen -W "$($1 --list-keys 2>/dev/null |
2534
command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur"))

0 commit comments

Comments
 (0)