dist/tools/zsh-completion: Add completion for DOCKER_IMAGE and OPENOCD_FTDI_ADAPTER#21860
Conversation
|
Note: I have not tested this on my other machine that uses |
|
Shellcheck seems to be unhappy with the syntax of the for loop, and I don't quite understand why it works. From what I found, for loops in Unrelated, but perhaps you could also add this to the script? Although it does not stop |
|
Hmm, a shebang I would expect in a user facing script file. The zsh completion sciprt is not expected to ever be run directly by a user. I'd rather not keep it without the shebang to prevent users running the script directly. shellcheck doesn't support zsh syntax and trips early on over the function definition syntax. It would be possible to change some parts to common POSIX syntax, but other parts require e.g. array variables as part of the completion API of zsh. There wouldn't also be a clear benefit in having this completion file more portable, as any other shell adapting the zsh completion API probably would also be compatible with the zsh syntax used here. I could rename the file to .zsh; I think iur CI won't try to run shellcheck on .zsh files. |
|
It does work just fine with |
This should prevent the CI from picking up the file for shellcheck linting. Sadly, shellcheck [does not support][1] zsh. [1]: koalaman/shellcheck#809
37d7933 to
4710d56
Compare
|
Thx ❤️ |
Contribution description
This extends the command completion for zsh for the variables
DOCKER_IMAGE=andOPENOCD_FTDI_ADAPTER=. Both lists are collected at run time from what is actually available on the system, so that we don't need to keep on maintaining lists of facts here.Testing procedure
cdinto a RIOT repo and typemake OPENOCD_Fand hit tab, it should complete tomake OPENOCD_FTDI_ADAPTER=. Tab again should list available FTDI adapter configs in OpenOCD and complete them as usualmake DOCKER_Iand hit tab. It should complete tomake DOCKER_IMAGE=. Tab again should list docker images installed on the system and complete them as usualIssues/PRs references
None