aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-11-26 16:18:55 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-11-26 16:18:55 -0200
commit17bfa3c574c8a44614053410edf06791cb432dbc (patch)
tree659892b220428fef6bb473b9049ec2accb9148bd /lib
parentf8641707496199e65eb37384791ff362d7710c72 (diff)
downloadkeyringer-17bfa3c574c8a44614053410edf06791cb432dbc.tar.gz
keyringer-17bfa3c574c8a44614053410edf06791cb432dbc.tar.bz2
New actions: tree and rm (alias for del)
Diffstat (limited to 'lib')
l---------lib/keyringer/actions/rm1
-rwxr-xr-xlib/keyringer/actions/tree19
-rw-r--r--lib/keyringer/completions/bash/keyringer2
-rw-r--r--lib/keyringer/completions/zsh/_keyringer2
4 files changed, 22 insertions, 2 deletions
diff --git a/lib/keyringer/actions/rm b/lib/keyringer/actions/rm
new file mode 120000
index 0000000..1a7ac23
--- /dev/null
+++ b/lib/keyringer/actions/rm
@@ -0,0 +1 @@
+del \ No newline at end of file
diff --git a/lib/keyringer/actions/tree b/lib/keyringer/actions/tree
new file mode 100755
index 0000000..2033abd
--- /dev/null
+++ b/lib/keyringer/actions/tree
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# List keys.
+#
+
+# Load functions
+LIB="`dirname $0`/../functions"
+source "$LIB" || exit 1
+
+# Aditional parameters
+CWD="`pwd`"
+
+# Avoid leading slash
+shift
+ARGS="`echo "$*" | sed -e "s|^/*||"`"
+
+# Run list command
+cd "$KEYDIR" && tree $ARGS
+cd "$CWD"
diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer
index bbd49f5..eeda27f 100644
--- a/lib/keyringer/completions/bash/keyringer
+++ b/lib/keyringer/completions/bash/keyringer
@@ -94,7 +94,7 @@ _keyringer() {
recipients)
opts="ls edit"
;;
- ls|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|recrypt|open)
+ ls|tree|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open)
cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash
opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)"
;;
diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer
index 5d0a64c..5717b00 100644
--- a/lib/keyringer/completions/zsh/_keyringer
+++ b/lib/keyringer/completions/zsh/_keyringer
@@ -50,7 +50,7 @@ _keyringer() {
recipients)
compadd "$@" ls edit
;;
- ls|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|recrypt|open)
+ ls|tree|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open)
words[4]="`echo $words[4] | sed -e "s|^/*||"`" # avoid leading slash
compadd "$@" $(KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null)
;;