-
Notifications
You must be signed in to change notification settings - Fork 3
/
quickpkg
36 lines (29 loc) · 882 Bytes
/
quickpkg
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
# bash completion for quickpkg
#
# Tony Williams, honestpuck@gmail.completion
# v1.0 2020-03-24
_quickpkg() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--ownership --output --clean --no-clean --relocatable --no-relocatable \
--sign --keychain --cert --verbosity --version --help"
own="recommended preserve preserve-other"
if [ $prev == "--ownership" ] ; then
COMPREPLY=($(compgen -W "$own" - "$cur"))
return
fi
if [ $prev == "--keychain" ] ; then
local keychains="$(security list-keychains)"
COMPREPLY=($(compgen -W "$keychains" -- "$cur"))
return
fi
case "$cur" in
-*)
COMPREPLY=($(compgen -W "$opts" - "$cur"))
return
;;
esac
}
complete -o bashdefault -o default -F _quickpkg quickpkg