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 <tokita.hiroshi@gmail.com>
This commit is contained in:
parent
b68071dc71
commit
af5850d44a
1 changed files with 48 additions and 0 deletions
|
@ -1142,6 +1142,53 @@ __comp_west_twister()
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__comp_west_sdk()
|
||||||
|
{
|
||||||
|
local bool_opts="
|
||||||
|
--interactive -i
|
||||||
|
--no-toolchains -T
|
||||||
|
--no-hosttools -H
|
||||||
|
"
|
||||||
|
|
||||||
|
local dir_opts="
|
||||||
|
--install-dir -d
|
||||||
|
--install-base -b
|
||||||
|
"
|
||||||
|
|
||||||
|
local other_opts="
|
||||||
|
--version
|
||||||
|
--toolchains -t
|
||||||
|
--personal-access-token
|
||||||
|
--api-url
|
||||||
|
"
|
||||||
|
|
||||||
|
all_opts="$bool_opts $dir_opts $other_opts"
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
sdk)
|
||||||
|
__set_comp "list install"
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
list)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
$(__west_to_extglob "$dir_opts") )
|
||||||
|
__set_comp_dirs
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
# We don't know how to autocomplete those
|
||||||
|
$(__west_to_extglob "$other_opts") )
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
|
__set_comp $all_opts
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
__comp_west()
|
__comp_west()
|
||||||
{
|
{
|
||||||
local previous_extglob_setting=$(shopt -p extglob)
|
local previous_extglob_setting=$(shopt -p extglob)
|
||||||
|
@ -1176,6 +1223,7 @@ __comp_west()
|
||||||
spdx
|
spdx
|
||||||
blobs
|
blobs
|
||||||
twister
|
twister
|
||||||
|
sdk
|
||||||
)
|
)
|
||||||
|
|
||||||
local cmds=(${builtin_cmds[*]} ${zephyr_ext_cmds[*]})
|
local cmds=(${builtin_cmds[*]} ${zephyr_ext_cmds[*]})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue