diff options
-rw-r--r-- | README.md | 16 | ||||
-rwxr-xr-x | cbt | 1 | ||||
-rwxr-xr-x | shell-integration/cbt-completions.bash | 13 |
3 files changed, 30 insertions, 0 deletions
@@ -176,3 +176,19 @@ solution could be code generating traits at build-time and mixing them in ad-hoc. It's a build-tool after all. Build-time code-generation and class loading is not rocket science. But there may be simpler solutions for the cases at hand. And they are edge cases anyways. + +Bash completions +---------------- +To auto-complete cbt task names in bash do this: + +``` +mkdir ~/.bash_completion.d/ +cp shell-integration/cbt-completions.bash ~/.bash_completion.d/ +``` + +Add this to you .bashrc +``` +for f in ~/.bash_completion.d/*; do + source $f +done +``` @@ -7,6 +7,7 @@ # - reduce code size by moving more of this into type-checked Java/Scala code (if possible without performance loss). # - reduction of dependencies # - performance improvements +shopt -qs extglob seconds() { date +"%s" diff --git a/shell-integration/cbt-completions.bash b/shell-integration/cbt-completions.bash new file mode 100755 index 0000000..c591321 --- /dev/null +++ b/shell-integration/cbt-completions.bash @@ -0,0 +1,13 @@ +#!/bin/bash +__cbt() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="$(cbt usage)" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 +} + +complete -F __cbt cbt |