summaryrefslogtreecommitdiff
path: root/provides/zsh/completions/_envstore
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-09-04 22:54:16 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-09-04 22:54:16 +0200
commit816bf0c345c08324b00a28b8d088ab23706ea4f1 (patch)
tree43e8f43db5cbd37e2ebaec5acf45966ece752f6b /provides/zsh/completions/_envstore
parent281dfc7f62f347fc137190db6e736a07ecb490e6 (diff)
completion: Don't use ->string for there are less weird ways
Diffstat (limited to 'provides/zsh/completions/_envstore')
-rw-r--r--provides/zsh/completions/_envstore24
1 files changed, 7 insertions, 17 deletions
diff --git a/provides/zsh/completions/_envstore b/provides/zsh/completions/_envstore
index 1b8a862..de39efb 100644
--- a/provides/zsh/completions/_envstore
+++ b/provides/zsh/completions/_envstore
@@ -7,7 +7,6 @@
local -a arguments_action arguments_action_nofile
local -a arguments_save arguments_rm arguments_eval
-local lstate
arguments_action=(
'1:action:(clear eval rm save show)'
@@ -20,15 +19,20 @@ arguments_action_nofile=(
# Also, don't complete parameters marked 'special', since they're usually
# specific to the current shell
arguments_save=(
- '2:parameter:->param'
+ '2:parameter:_parameters -g "(scalar|integer)*export"'
)
arguments_rm=(
- '2:saved parameter:->saved_param'
+ '2:saved parameter:_saved_param'
)
arguments_eval=(
'2::option:(-e)'
)
+function _saved_param () {
+ _wanted parameter expl 'saved parameter' \
+ compadd $(envstore eval -e | cut -d ' ' -f 2 | cut -d '=' -f 1)
+}
+
if (( CURRENT >= 3 )) {
case ${words[2]} in
eval) _arguments -s $arguments_eval ;;
@@ -40,17 +44,3 @@ if (( CURRENT >= 3 )) {
} else {
_arguments -s $arguments_action_nofile
}
-
-while [[ -n $state ]]; do
- lstate=$state
- state=''
- case $lstate in
- param)
- _parameters -g '(scalar|integer)*export'
- ;;
- saved_param)
- _wanted parameter expl 'saved parameter' \
- compadd $(envstore eval -e | cut -d ' ' -f 2 | cut -d '=' -f 1)
- ;;
- esac
-done