Skip to content

Commit ead434d

Browse files
committed
dist/tools/zsh-completion: Add completion for OPENOCD_FTDI_ADAPTER
1 parent a6cfc3f commit ead434d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dist/tools/zsh-completion/zsh-riot.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
OPENOCD_SCRIPTS_PATH=${OPENOCD_SCRIPTS_PATH:-/usr/share/openocd/scripts/}
2+
13
function _boards {
24
local -a _boards_available
35
local -a _board_dirs
@@ -78,6 +80,11 @@ function _hw_programmers {
7880
_describe 'hw_programmer' _hw_programmer_vals
7981
}
8082

83+
function _ftdi_adapter {
84+
local -a _adapter_vals=($(find "$OPENOCD_SCRIPTS_PATH"/interface/ftdi -type f -name '*.cfg' -exec basename --suffix=.cfg {} \;))
85+
_describe 'ftdi_adapter' _adapter_vals
86+
}
87+
8188
function _riot {
8289
local -a _std_targets=(
8390
"all:build the application"
@@ -130,6 +137,7 @@ function _riot {
130137
'RIOT_CI_BUILD[Behave as in the CI: Less verbose output, reproducible builds, ...]:bool:_bools'
131138
'PROGRAMMER[Select the programmer software to flash (debug) with]:programmer:_programmers'
132139
'OPENOCD_DEBUG_ADAPTER[Select the programmer hardware to use with OpenOCD]:hw_programmer:_hw_programmers'
140+
'OPENOCD_FTDI_ADAPTER[Select the FTDI adapter config to use with OpenOCD]:ftdi_adapter:_ftdi_adapter'
133141
'OPENOCD_RESET_USE_CONNECT_ASSERT_SRST[Let OpenOCD attach while reset signal is asserted]:bool:_bools'
134142
'STATIC_ANALYSIS[Enable static analysis for modules that claim support]:bool:_bools'
135143
)

0 commit comments

Comments
 (0)