diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-14 11:20:17 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-14 11:20:17 +0200 |
commit | 37d43c0b237f413e8185272d20c3fc97542c4e0f (patch) | |
tree | 78933fa712a5f9a1de3bdf36eae5e4d1adf06d15 /provides/zsh/completions/_envstore | |
parent | ebf72acb785e1fe9a09b6eed1371680e15552563 (diff) |
zsh completion: Less _arguments
Diffstat (limited to 'provides/zsh/completions/_envstore')
-rw-r--r-- | provides/zsh/completions/_envstore | 27 |
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' } |