summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--provides/zsh/completions/_envstore27
1 files changed, 20 insertions, 7 deletions
diff --git a/provides/zsh/completions/_envstore b/provides/zsh/completions/_envstore
index 19c4e7d..8e1f37a 100644
--- a/provides/zsh/completions/_envstore
+++ b/provides/zsh/completions/_envstore
@@ -24,14 +24,27 @@ function _saved_param () {
compadd $(envstore eval -e | cut -d ' ' -f 2 | cut -d '=' -f 1)
}
-if (( CURRENT >= 3 )) {
+if (( CURRENT == 2 )) {
+ if [[ -r /tmp/envstore-$UID ]] {
+ _describe command options
+ } else {
+ _describe command options_nofile
+ }
+} elif (( CURRENT == 3 )) {
+
case ${words[2]} in
- eval) _arguments -s '2::option:(-e)' ;;
- rm) _arguments -s '2:saved parameter:_saved_param' ;;
- save) _arguments -s '2:parameter:_parameters -g "(scalar|integer)*export"' ;;
+ eval)
+ _arguments -s '2::option:(-e)'
+ ;;
+ rm)
+ _saved_param
+ ;;
+ save)
+ _parameters -g '(scalar|integer)*export'
+ ;;
+ *)
+ _message 'no more arguments'
esac
-} elif [[ -r /tmp/envstore-$UID ]] {
- _describe command options
} else {
- _describe command options_nofile
+ _message 'no more arguments'
}