diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2002-03-04 08:53:41 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2002-03-04 08:53:41 +0000 |
commit | f56ba813bb92b1d61be91cb39df620b37a5a0588 (patch) | |
tree | 6b7432b8e437bfbd92b7859e0c9e38dd11277f1d /Completion/Zsh/Context/_redirect | |
parent | 10490ec499fff7b932f92a0b19c7e5343a24761d (diff) | |
download | zsh-f56ba813bb92b1d61be91cb39df620b37a5a0588.tar.gz zsh-f56ba813bb92b1d61be91cb39df620b37a5a0588.tar.xz zsh-f56ba813bb92b1d61be91cb39df620b37a5a0588.zip |
allow different sets of completion definitions selected with option -T to compdef; use this for parameter values and redirections (16755)
Diffstat (limited to 'Completion/Zsh/Context/_redirect')
-rw-r--r-- | Completion/Zsh/Context/_redirect | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Completion/Zsh/Context/_redirect b/Completion/Zsh/Context/_redirect index 6e02636da..5e454014b 100644 --- a/Completion/Zsh/Context/_redirect +++ b/Completion/Zsh/Context/_redirect @@ -1,3 +1,17 @@ #compdef -redirect- -_files +# This searches for `<command-name>:<redir-op>' and `<redir-op>', where +# `<redir-op>' is something like `<' or `2>'. + +local strs _comp_command1 _comp_command2 + +_set_command + +strs=( "$compstate[redirect]" ) + +if [[ -n "$_comp_command1" ]]; then + strs=( "${_comp_command1}:$strs[-1]" "$strs[@]" ) + [[ -n "$_comp_command2" ]] && strs=( "${_comp_command2}:$strs[1]" "$strs[@]" ) +fi + +_dispatch -d redirs "$strs[@]" |