diff options
| author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2002-01-21 16:13:15 +0000 |
|---|---|---|
| committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2002-01-21 16:13:15 +0000 |
| commit | f463b09b133f8c798750334558b99d633c1a2219 (patch) | |
| tree | 0f203d91189b49d084fee0cd32d6dc77b9a935b2 /Completion/Base/Utility | |
| parent | *** empty log message *** (diff) | |
| download | zsh-f463b09b133f8c798750334558b99d633c1a2219.tar zsh-f463b09b133f8c798750334558b99d633c1a2219.tar.gz zsh-f463b09b133f8c798750334558b99d633c1a2219.tar.bz2 zsh-f463b09b133f8c798750334558b99d633c1a2219.tar.lz zsh-f463b09b133f8c798750334558b99d633c1a2219.tar.xz zsh-f463b09b133f8c798750334558b99d633c1a2219.tar.zst zsh-f463b09b133f8c798750334558b99d633c1a2219.zip | |
allow arguments to be given to functions used by compdef (actually, the strings are eval'uated, so this should be powerful enough) (16472)
Diffstat (limited to 'Completion/Base/Utility')
| -rw-r--r-- | Completion/Base/Utility/_contexts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Completion/Base/Utility/_contexts b/Completion/Base/Utility/_contexts index 680f2019f..f0e5ba874 100644 --- a/Completion/Base/Utility/_contexts +++ b/Completion/Base/Utility/_contexts @@ -7,11 +7,17 @@ # `_contexts -math-' to get the completions that would be generated for a # mathematical context. -local i tmp ret=1 service +local i tmp ret=1 service or + +if [[ $1 = -o ]]; then + or=yes + shift +fi for i; do tmp="$_comps[$i]" - [[ -z "$tmp" ]] || service="${_services[$i]:-$i}" && "$tmp" && ret=0 + [[ -n "$tmp" ]] && service="${_services[$i]:-$i}" && eval "$tmp" && ret=0 + [[ -n "$or" && ret -eq 0 ]] && return 0 done return ret |
