-
Notifications
You must be signed in to change notification settings - Fork 16
/
ebuildtester.bash-completion
67 lines (64 loc) · 1.53 KB
/
ebuildtester.bash-completion
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# vim: syntax=sh:tabstop=4:shiftwidth=4:expandtab
_ebuildtester() {
local cur prev opts prefix
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=(
--help
--version
--atom
--binhost
--live-ebuild
--manual
--portage-dir
--overlay-dir
--update
--install-basic-packages
--threads
--use
--global-use
--unmask
--unstable
--gcc-version
--python-single-target
--python-targets
--rm
--storage-opt
--with-X
--with-vnc
--profile
--features
--docker-image
--docker-command
--pull
--show-options
--ccache
--batch
--debug
)
case "${prev}" in
--portage-dir|--overlay-dir|--ccache)
COMPREPLY=( $(compgen -o filenames -o dirnames -o plusdirs ${cur}) )
compopt -o nospace -o filenames -o dirnames -o plusdirs
;;
--features)
if [[ ${cur} =~ ^- ]]; then
prefix=("-P" "-")
else
prefix=()
fi
echo
COMPREPLY=( $(compgen ${prefix[@]} -W "ccache sandbox userfetch" -- ${cur#-}) )
;;
*)
if [[ ${cur} =~ ^-.* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) )
else
echo "I should not be here"
exit 1
fi
;;
esac
}
complete -F _ebuildtester ebuildtester