diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 11:22:38 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 11:22:38 +0000 |
commit | 766b77fb1bbc8c5286ec9adc43f1860b38bb9060 (patch) | |
tree | 87b8948431b8fa40e237fb78685382b39427e4f0 | |
parent | e7e55a73c14a7b56d17f3c9e141e4148f566b6f5 (diff) | |
download | zsh-766b77fb1bbc8c5286ec9adc43f1860b38bb9060.tar.gz zsh-766b77fb1bbc8c5286ec9adc43f1860b38bb9060.tar.xz zsh-766b77fb1bbc8c5286ec9adc43f1860b38bb9060.zip |
moved from Completion/Base/_default
-rw-r--r-- | Completion/Zsh/Context/_default | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Completion/Zsh/Context/_default b/Completion/Zsh/Context/_default new file mode 100644 index 000000000..8176f392c --- /dev/null +++ b/Completion/Zsh/Context/_default @@ -0,0 +1,27 @@ +#compdef -default- + +local ctl + +if { zstyle -s ":completion:${curcontext}:" use-compctl ctl || + zmodload -e zsh/compctl } && [[ "$ctl" != (no|false|0|off) ]]; then + local opt + + opt=() + [[ "$ctl" = *first* ]] && opt=(-T) + [[ "$ctl" = *default* ]] && opt=("$opt[@]" -D) + compcall "$opt[@]" || return 0 +fi + +_files "$@" && return 0 + +# magicequalsubst allows arguments like <any-old-stuff>=~/foo to do +# file name expansion after the =. In that case, it's natural to +# allow completion to handle file names after any equals sign. + +if [[ -o magicequalsubst && "$PREFIX" = *\=* ]]; then + compstate[parameter]="${words[1]:t}-${PREFIX%%\=*}" + compset -P 1 '*=' + _value "$@" +else + return 1 +fi |