summaryrefslogtreecommitdiff
path: root/provides/zsh/completions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-08-17 10:53:25 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-08-17 10:53:25 +0200
commit29d9fc7eb4c4210f07b11c11efbdc211830a8439 (patch)
treeaf05f8affe09978d222cf49a11232cdf57bd92e5 /provides/zsh/completions
parent0a3a39559ec427f4d19a27414919d2421c36c9de (diff)
Added zsh completion
Diffstat (limited to 'provides/zsh/completions')
-rw-r--r--provides/zsh/completions/_envstore31
1 files changed, 31 insertions, 0 deletions
diff --git a/provides/zsh/completions/_envstore b/provides/zsh/completions/_envstore
new file mode 100644
index 0000000..7df2b3c
--- /dev/null
+++ b/provides/zsh/completions/_envstore
@@ -0,0 +1,31 @@
+#compdef envstore
+## vim:ft=zsh
+## completion for envstore release-3
+## Daniel Friesel <derf@derf.homelinux.org>
+## https://derf.homelinux.org/~derf/dotfiles/zsh/completions/_envstore
+## see also: http://git.cloudconnected.org/?p=envstore.git;a=summary
+
+local arguments_action arguments_save arguments_rm arguments_eval
+
+arguments_action=(
+ '1:action:(clear eval rm save show)'
+)
+arguments_save=(
+ '2:variable:_parameters -g \*-export'
+)
+arguments_rm=(
+ '2:variable:($(envstore eval -e | cut -d " " -f 2 | cut -d "=" -f 1))'
+)
+arguments_eval=(
+ '2::option:(-e)'
+)
+
+if [[ $CURRENT -ge 3 ]] {
+ case ${words[2]} in
+ eval) _arguments -s $arguments_eval ;;
+ rm) _arguments -s $arguments_rm ;;
+ save) _arguments -s $arguments_save ;;
+ esac
+} else {
+ _arguments -s $arguments_action
+}