From bf2a1aca90328a57d9adb2c6fcb9a98880f11f17 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 2 Apr 2001 11:10:27 +0000 Subject: moved from Completion/Core/_compalso --- Completion/Base/Utility/_contexts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Completion/Base/Utility/_contexts (limited to 'Completion/Base/Utility/_contexts') diff --git a/Completion/Base/Utility/_contexts b/Completion/Base/Utility/_contexts new file mode 100644 index 000000000..680f2019f --- /dev/null +++ b/Completion/Base/Utility/_contexts @@ -0,0 +1,17 @@ +#autoload + +# This searches $* in the array for normal completions and calls the result. +# It is used to include completions for another command or special context +# into the list generated by the calling function. +# For example the function for `-subscript-' could call this as in +# `_contexts -math-' to get the completions that would be generated for a +# mathematical context. + +local i tmp ret=1 service + +for i; do + tmp="$_comps[$i]" + [[ -z "$tmp" ]] || service="${_services[$i]:-$i}" && "$tmp" && ret=0 +done + +return ret -- cgit 1.4.1