Skip to content

Commit af5850d

Browse files
soburinashif
authored andcommitted
scripts: west_commands: completion: bash: Add support for west sdk
Add a feature for completion of the `west sdk` command. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent b68071d commit af5850d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

scripts/west_commands/completion/west-completion.bash

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,53 @@ __comp_west_twister()
11421142
esac
11431143
}
11441144

1145+
__comp_west_sdk()
1146+
{
1147+
local bool_opts="
1148+
--interactive -i
1149+
--no-toolchains -T
1150+
--no-hosttools -H
1151+
"
1152+
1153+
local dir_opts="
1154+
--install-dir -d
1155+
--install-base -b
1156+
"
1157+
1158+
local other_opts="
1159+
--version
1160+
--toolchains -t
1161+
--personal-access-token
1162+
--api-url
1163+
"
1164+
1165+
all_opts="$bool_opts $dir_opts $other_opts"
1166+
1167+
case "$prev" in
1168+
sdk)
1169+
__set_comp "list install"
1170+
return
1171+
;;
1172+
list)
1173+
return
1174+
;;
1175+
$(__west_to_extglob "$dir_opts") )
1176+
__set_comp_dirs
1177+
return
1178+
;;
1179+
# We don't know how to autocomplete those
1180+
$(__west_to_extglob "$other_opts") )
1181+
return
1182+
;;
1183+
esac
1184+
1185+
case "$cur" in
1186+
-*)
1187+
__set_comp $all_opts
1188+
;;
1189+
esac
1190+
}
1191+
11451192
__comp_west()
11461193
{
11471194
local previous_extglob_setting=$(shopt -p extglob)
@@ -1176,6 +1223,7 @@ __comp_west()
11761223
spdx
11771224
blobs
11781225
twister
1226+
sdk
11791227
)
11801228

11811229
local cmds=(${builtin_cmds[*]} ${zephyr_ext_cmds[*]})

0 commit comments

Comments
 (0)