BuildSystem: Add bos short hand for building with zsh completions :)

This commit is contained in:
Bananymous 2023-10-28 22:23:29 +03:00
parent 76f48f095c
commit 2d34b2b8a3
3 changed files with 23 additions and 0 deletions

View File

@ -41,6 +41,10 @@ If you have corrupted your disk image or want to create new one, you can either
> ***NOTE*** ```ninja clean``` has to be ran with root permissions, since it deletes from the banan-so sysroot.
If you feel like ```./script/build.sh``` is too verbose, there exists a symlink _bos_ in this projects root directory. All build commands can be used with ```./bos args...``` instead.
I have also created shell completion script for zsh. You can either copy the file in _script/shell-completion/zsh/\_bos_ to _/usr/share/zsh/site-functions/_ or add the _script/shell-completion/zsh_ to your fpath in _.zshrc_.
### Contributing
Currently I don't accept contributions to this repository unless explicitly told otherwise. This is a learning project for me and I want to do everything myself. Feel free to fork/clone this repo and tinker with it yourself.

1
bos Symbolic link
View File

@ -0,0 +1 @@
script/build.sh

View File

@ -0,0 +1,18 @@
#compdef bos
__ninja_targets() {
ninja -C build -f build.ninja -t targets all 2>/dev/null | cut -d: -f1 | grep -vi cmake
}
__build_targets() {
grep -o '[a-zA-Z-]\+)$' script/build.sh 2>/dev/null | cut -d')' -f1
}
__targets() {
local -a targets
targets=($(__ninja_targets) $(__build_targets))
_describe 'targets' targets
}
_arguments '*::targets:__targets'