Browse Source

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>
pull/69687/head
Jamie McCrae 1 year ago committed by Carles Cufi
parent
commit
4b90b30b9d
  1. 10
      scripts/west_commands/completion/west-completion.fish

10
scripts/west_commands/completion/west-completion.fish

@ -196,11 +196,21 @@ function __zephyr_west_complete_help @@ -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'

Loading…
Cancel
Save