-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbcs.bash_completion
More file actions
120 lines (110 loc) · 3.67 KB
/
bcs.bash_completion
File metadata and controls
120 lines (110 loc) · 3.67 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# bcs(1) bash completion
# shellcheck shell=bash
_bcs() {
local -- cur prev words cword
_init_completion || return
local -r subcommands='display template check codes generate help'
# Find the subcommand (first non-option word after 'bcs')
local -- subcmd='' i
for ((i = 1; i < cword; i+=1)); do
case ${words[i]} in
-*) continue ;;
*) subcmd=${words[i]}; break ;;
esac
done
# Top-level: complete subcommands and global options
if [[ -z "$subcmd" ]]; then
case $cur in
-*) mapfile -t COMPREPLY < <(compgen -W '-V --version -v --verbose -q --quiet -h --help' -- "$cur") ;;
*) mapfile -t COMPREPLY < <(compgen -W "$subcommands" -- "$cur") ;;
esac
return
fi
# Per-subcommand completions
case $subcmd in
display)
mapfile -t COMPREPLY < <(compgen -W '-c --cat -f --file -S --symlink -v --verbose -q --quiet -h --help' -- "$cur")
;;
template)
case $prev in
-t|--type)
mapfile -t COMPREPLY < <(compgen -W 'minimal basic complete library' -- "$cur")
return
;;
-o|--output)
_filedir
return
;;
-n|--name|-d|--desc|-V|--version)
return
;;
esac
mapfile -t COMPREPLY < <(compgen -W '-t --type -n --name -d --desc -V --version -o --output -x --executable -f --force -v --verbose -q --quiet -h --help' -- "$cur")
;;
check)
case $prev in
-e|--effort)
mapfile -t COMPREPLY < <(compgen -W 'low medium high max' -- "$cur")
return
;;
-T|--tier|-M|--min-tier)
mapfile -t COMPREPLY < <(compgen -W 'core recommended style' -- "$cur")
return
;;
-m|--model)
mapfile -t COMPREPLY < <(compgen -W '
fast balanced thorough
claude-code claude-code:fast claude-code:balanced claude-code:thorough
claude-haiku-4-5 claude-sonnet-4-6 claude-opus-4-6
gemini-2.5-flash-lite gemini-2.5-flash gemini-2.5-pro
gpt-4.1-mini gpt-5.4-mini gpt-5.4
minimax-m2:cloud minimax-m2.7:cloud qwen3-coder:480b-cloud
deepseek-v3.1:671b-cloud gpt-oss:120b-cloud glm-5.1:cloud
' -- "$cur")
return
;;
esac
case $cur in
-*)
mapfile -t COMPREPLY < <(compgen -W '-m --model -e --effort -s --strict -S --no-strict -T --tier -M --min-tier -D --debug -v --verbose -q --quiet -h --help' -- "$cur")
;;
*)
_filedir
;;
esac
;;
codes)
case $prev in
-T|--tier)
mapfile -t COMPREPLY < <(compgen -W 'core recommended style disabled' -- "$cur")
return
;;
-E|--explain)
# best-effort: completions list common codes
mapfile -t COMPREPLY < <(compgen -W '
BCS0101 BCS0106 BCS0107 BCS0109 BCS0110 BCS0202 BCS0206
BCS0301 BCS0302 BCS0303 BCS0406 BCS0407 BCS0410 BCS0411
BCS0501 BCS0503 BCS0504 BCS0606 BCS0604 BCS0801 BCS0803
BCS0901 BCS0906 BCS1001 BCS1002 BCS1004 BCS1006 BCS1007
BCS1101 BCS1103 BCS1104 BCS1202 BCS1204 BCS1206
' -- "$cur")
return
;;
esac
mapfile -t COMPREPLY < <(compgen -W '-T --tier -E --explain -p --plain -x --exclude-disabled -h --help' -- "$cur")
;;
generate)
case $prev in
-o|--output)
_filedir
return
;;
esac
mapfile -t COMPREPLY < <(compgen -W '-o --output -v --verbose -q --quiet -h --help' -- "$cur")
;;
help)
mapfile -t COMPREPLY < <(compgen -W "$subcommands" -- "$cur")
;;
esac
} && complete -F _bcs bcs
#fin