-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautocomplete.sh
More file actions
45 lines (37 loc) · 884 Bytes
/
autocomplete.sh
File metadata and controls
45 lines (37 loc) · 884 Bytes
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
#!/usr/bin/env bash -x
_build_completions() {
current="${COMP_WORDS[COMP_CWORD]}"
commands=("config" "build" "mkimg" "flash")
now_commands=(":build" ":mkimg" ":flash")
#if [[ ${COMP_CWORD} == 1 ]]
#then
# COMPREPLY+=($(compgen -W "${commands[@]}" -- ${current}))
# return 0
#fi
special=("name=" "os_patch_level=" "model=")
default_enabled=()
for i in kernel/configs/cruel+*.conf
do
flag="$(echo $(basename "$i" .conf) | cut -d '+' -f 2)"
default_enabled+=("${flag}")
done
default_disabled=()
for i in kernel/configs/cruel-*.conf
do
flag="$(echo $(basename "$i" .conf) | cut -d '-' -f 2)"
default_disabled+=("${flag}")
done
enabled=()
disabled=()
for i in "${COMP_WORDS[@]}"
do
if [[ " ${array[@]} " =~ " ${i} " ]]
then
fi
done
for i in "${enabled[@]}" "${disabled[@]}"
do
COMPREPLY+=("$i")
done
}
complete -F _build_completions build