mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-19 03:23:49 +01:00
This adds command completion that, when manually installed, provides
RIOT-aware command completion for `make` in zsh. The completion
supports:
- most commonly used `make` goals including a help text
- most commonly used `make` variables (such as `BOARD=`, `LTO=`,
`BUILD_IN_DOCKER=`, `TOOLCHAIN=`)
- possible values for these variables, including a list of boards
detected at runtime to complete `BOARD=`
Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
932 B
932 B
Command Line Completion Using ZSH
This provides command line completion for zsh to increase productivity when
working with RIOT build system. The completion focuses on make targets,
options, and variables commonly used when interacting with the RIOT build system
from the shell. Aspects of the build system typically only used by scripts or
the CI are (intentionally) not added.
Installation
- Copy the
zsh-riot.shscript where you can find it, e.g.cp zsh-riot.sh ~/.zsh-riot.sh - Hook up the custom RIOT specific make completion in
.zshrcand use that instead of the defaultmakecompletion if and only if the working directory is inside a RIOT repository. This can be done by adding the following snippet:
source ~/.zsh-riot.sh
compdef '
if git rev-parse --is-inside-work-tree &> /dev/null && [[ -e "$(git rev-parse --show-toplevel)/.murdock" ]]; then
_riot
else
_make
fi
' make