diff --git a/README.md b/README.md index 6671064d..959f09a4 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/bos b/bos new file mode 120000 index 00000000..1dd2819b --- /dev/null +++ b/bos @@ -0,0 +1 @@ +script/build.sh \ No newline at end of file diff --git a/script/shell-completion/zsh/_bos b/script/shell-completion/zsh/_bos new file mode 100644 index 00000000..d695cafc --- /dev/null +++ b/script/shell-completion/zsh/_bos @@ -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' +