-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathframework_tool
More file actions
executable file
·89 lines (82 loc) · 2.49 KB
/
framework_tool
File metadata and controls
executable file
·89 lines (82 loc) · 2.49 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env bash
# Bash completion for framework_tool
_framework_tool() {
local options
options=(
"--flash-gpu-descriptor"
"-v" "--verbose"
"-q" "--quiet"
"--versions"
"--version"
"--features"
"--esrt"
"--device"
"--compare-version"
"--power"
"--thermal"
"--sensors"
"--pdports"
"--info"
"--pd-info"
"--dp-hdmi-info"
"--dp-hdmi-update"
"--audio-card-info"
"--privacy"
"--pd-bin"
"--ec-bin"
"--capsule"
"--dump"
"--ho2-capsule"
"--dump-ec-flash"
"--flash-ec"
"--flash-ro-ec"
"--flash-rw-ec"
"--intrusion"
"--inputdeck"
"--inputdeck-mode"
"--charge-limit"
"--get-gpio"
"--fp-led-level"
"--fp-brightness"
"--kblight"
"--rgbkbd"
"--tablet-mode"
"--touchscreen-enable"
"--console"
"--reboot-ec"
"--hash"
"--driver"
"--pd-addrs"
"--pd-ports"
"--has-mec"
"-t" "--test"
"-h" "--help"
)
local devices=("bios" "ec" "pd0" "pd1" "rtm01" "rtm23" "ac-left" "ac-right")
local inputdeck_modes=("auto" "off" "on")
local console_modes=("recent" "follow")
local drivers=("portio" "cros-ec" "windows")
local has_mec_options=("true" "false")
local brightness_options=("high" "medium" "low" "ultra-low")
local current_word prev_word
current_word="${COMP_WORDS[COMP_CWORD]}"
prev_word="${COMP_WORDS[COMP_CWORD-1]}"
# Handle options
if [[ $COMP_CWORD -eq 1 ]]; then
COMPREPLY=( $(compgen -W "${options[*]}" -- "$current_word") )
elif [[ $prev_word == "--device" ]]; then
COMPREPLY=( $(compgen -W "${devices[*]}" -- "$current_word") )
elif [[ $prev_word == "--inputdeck-mode" ]]; then
COMPREPLY=( $(compgen -W "${inputdeck_modes[*]}" -- "$current_word") )
elif [[ $prev_word == "--console" ]]; then
COMPREPLY=( $(compgen -W "${console_modes[*]}" -- "$current_word") )
elif [[ $prev_word == "--driver" ]]; then
COMPREPLY=( $(compgen -W "${drivers[*]}" -- "$current_word") )
elif [[ $prev_word == "--has-mec" ]]; then
COMPREPLY=( $(compgen -W "${has_mec_options[*]}" -- "$current_word") )
elif [[ $prev_word == "--fp-brightness" ]]; then
COMPREPLY=( $(compgen -W "${brightness_options[*]}" -- "$current_word") )
fi
return 0
}
complete -F _framework_tool framework_tool