From aa99b19c088324b17c0c5e1caee4fc3b5777deab Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 26 Apr 2001 12:13:36 +0000 Subject: rename -W option to -w, add new -W option which makes _arguments complete options even after options that get their argument in the same word; new _guard function for conditionally displaying messages (14105) --- Completion/Base/Utility/_guard | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Completion/Base/Utility/_guard (limited to 'Completion/Base/Utility/_guard') diff --git a/Completion/Base/Utility/_guard b/Completion/Base/Utility/_guard new file mode 100644 index 000000000..4c07fe1b9 --- /dev/null +++ b/Completion/Base/Utility/_guard @@ -0,0 +1,17 @@ +#autoload + +local mesg pat garbage + +mesg=() +zparseopts -K -D -a garbage M: J: V: 1 2 n F: X:=mesg + +[[ "$PREFIX$SUFFIX" != $~1 ]] && return 1 + +if [[ $# -gt 1 || $#mesg -eq 0 ]]; then + shift + _message "$*" +else + _message -r "$mesg[2]" +fi + +[[ -n "$PREFIX$SUFFIX" ]] -- cgit 1.4.1