From 26dbb6af9ebf1d55b1543ff4db86f83f2a59307d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 16 Aug 2013 22:42:46 -0300 Subject: Initial zsh completion --- lib/keyringer/completions/zsh/_keyringer | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/keyringer/completions/zsh/_keyringer (limited to 'lib/keyringer/completions/zsh') 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 "$@" -- cgit v1.2.3