blob: c79350044400270c86e8ac36c042664834a1903d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#autoload
# Options (only in separate words):
#
# -a use all signals (even the pseudo-signals)
# -p needs a `-' prefix
#
# A `-' or `--' as the first argument is ignored.
local expl last=-3 minus
while [[ "$1" = -[ap] ]]; do
if [[ "$1" = -a ]]; then
last=-1
else
minus=-
fi
shift
done
[[ "$1" = -(|-) ]] && shift
if _wanted signals expl signal &&
{ [[ -z "$minus" ]] || ! _style signals prefix-needed ||
[[ "$PREFIX" = -* ]] } ; then
local disp tmp
if _style signals prefix-hidden; then
tmp=( "${(@)signals[1,last]}" )
disp=(-d tmp)
else
disp=()
fi
compadd "$@" "$expl[@]" "$disp[@]" -M 'm:{a-z}=${A-Z}' - \
"${minus}${(@)^signals[1,last]}"
fi
|