diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/completions/_envstore | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/etc/completions/_envstore b/etc/completions/_envstore index 0be548e..2f9c18d 100644 --- a/etc/completions/_envstore +++ b/etc/completions/_envstore @@ -1,11 +1,27 @@ #compdef envstore ## vim:ft=zsh -local arguments +local arguments_action arguments_save arguments_rm arguments_eval -arguments=( - ':action:(clear eval rm save show)' - ':variable:_parameters -g \*-export' +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)' ) -_arguments -s $arguments +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 +} |