From f463b09b133f8c798750334558b99d633c1a2219 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 21 Jan 2002 16:13:15 +0000 Subject: allow arguments to be given to functions used by compdef (actually, the strings are eval'uated, so this should be powerful enough) (16472) --- Completion/Base/Utility/_contexts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Completion/Base/Utility/_contexts') 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 -- cgit 1.4.1