aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-29 18:15:24 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-29 18:15:24 +0300
commitdd5217885ee3a5ad0637ebae4cbefe40071aa8c1 (patch)
tree7a627a1a71938316133f357e576f2ea28812f32e
parentf9c0cbe0340e22f9bb11e77b6c0f302364c391db (diff)
downloadarching-kaos-tools-dd5217885ee3a5ad0637ebae4cbefe40071aa8c1.tar.gz
arching-kaos-tools-dd5217885ee3a5ad0637ebae4cbefe40071aa8c1.tar.bz2
arching-kaos-tools-dd5217885ee3a5ad0637ebae4cbefe40071aa8c1.zip
ak-gpg: new flag --list-keys
-rwxr-xr-xbin/ak-gpg5
-rwxr-xr-xlib/_ak_gpg4
2 files changed, 6 insertions, 3 deletions
diff --git a/bin/ak-gpg b/bin/ak-gpg
index 5ff9e6e..63d0c7b 100755
--- a/bin/ak-gpg
+++ b/bin/ak-gpg
@@ -10,7 +10,9 @@
##
## --get-key-self-as-fingerprint Returns the fingerprint of your key
##
-## --get-key-fingerprint-from-ipfs Returns the fingerprint of a given key
+## --get-key-fingerprint-from-ipfs Returns the fingerprint of a given key
+##
+## --list-keys Returns a list of known GPG keys
##
fullprogrampath="$(realpath $0)"
PROGRAM=$(basename $0)
@@ -31,6 +33,7 @@ if [ ! -z $1 ]; then
--get-key-self-as-ipfs) _ak_gpg_key_self_get_fingerprint_from_config; exit;;
--get-key-self-as-fingerprint) _ak_gpg_key_self_get_fingerprint; exit;;
--get-key-fingerprint-from-ipfs) _ak_gpg_key_get_fingerprint_from_ipfs $1; exit;;
+ --list-keys) _ak_gpg_list_keys; exit;;
* ) _ak_usage;;
esac
else _ak_usage
diff --git a/lib/_ak_gpg b/lib/_ak_gpg
index 81229e1..d220a4b 100755
--- a/lib/_ak_gpg
+++ b/lib/_ak_gpg
@@ -119,11 +119,11 @@ _ak_gpg_key_self_export(){
}
_ak_gpg_list_keys(){
- _ak_gpg --list-keys | grep '^ ' | awk '{print $1}' | tr '\n' ' '
+ _ak_gpg --list-keys | grep '^ ' | awk '{print $1}'
}
_ak_gpg_select_key(){
- select x in $(_ak_gpg_list_keys)
+ select x in $(_ak_gpg_list_keys | tr '\n' ' ')
do
echo $x
if [ -n "$x" ]