about summary refs log tree commit diff
path: root/Completion/Base/Utility/_guard
blob: 4c07fe1b98b8564db07671fac6840e8d2ecedb98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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" ]]