summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/keyringer/completions/bash/keyringer (renamed from lib/keyringer/completions/bash)0
-rw-r--r--lib/keyringer/completions/zsh/_keyringer30
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/keyringer/completions/bash b/lib/keyringer/completions/bash/keyringer
index 4459b34..4459b34 100644
--- a/lib/keyringer/completions/bash
+++ b/lib/keyringer/completions/bash/keyringer
diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer
new file mode 100644
index 0000000..1f1c250
--- /dev/null
+++ b/lib/keyringer/completions/zsh/_keyringer
@@ -0,0 +1,30 @@
+#compdef keyringer
+
+_keyringer() {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ # Initial options
+ local config="$HOME/.keyringer"
+ local keyrings="`ls $config | sed -e 's/config//'`"
+
+ _arguments \
+ '1: :->keyring'\
+ '2: :->action'\
+ '*: :->options'
+
+ case $state in
+ keyring)
+ _arguments "1:Keyrings:($keyrings)"
+ ;;
+ action)
+ compadd "$@" `keyringer $words[2] commands`
+ ;;
+ *)
+ # TODO
+ true
+ ;;
+ esac
+}
+
+_keyringer "$@"