scripts: west_commands: completion: Add hwmv2 complete to fish
Adds hwmv2 board completetion support to fish Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
committed by
Carles Cufi
parent
0f6842e2fa
commit
4b90b30b9d
@@ -196,11 +196,21 @@ function __zephyr_west_complete_help
|
||||
end
|
||||
|
||||
function __zephyr_west_complete_board
|
||||
# HWMv1
|
||||
set -l boards (west 2>/dev/null boards --format="{name} {arch}")
|
||||
for board in $boards
|
||||
set -l b (string split " " $board)
|
||||
printf "%s\n" $b[1]\t"$b[2]"
|
||||
end
|
||||
|
||||
# HWMv2
|
||||
set -l boards (west 2>/dev/null boards --format="{identifiers}")
|
||||
for board in $boards
|
||||
set -l b (string split "," $board)
|
||||
for variant in $b
|
||||
printf "%s\n" $variant[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# disable file completion, if an option need it, it should use '--force-files'
|
||||
|
||||
Reference in New Issue
Block a user