diff options
author | ChavXO <mchavinda@colgate.edu> | 2016-05-21 21:53:44 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-08-28 23:38:05 -0400 |
commit | 1114a970940633d8cfb7b018ce4d71dc1544b5e5 (patch) | |
tree | 1130c654b6b542987249e57e14e872cc7a6826c7 | |
parent | c35fd1fd51c44cbb954084d0e048b3613c7cdd45 (diff) | |
download | cbt-1114a970940633d8cfb7b018ce4d71dc1544b5e5.tar.gz cbt-1114a970940633d8cfb7b018ce4d71dc1544b5e5.tar.bz2 cbt-1114a970940633d8cfb7b018ce4d71dc1544b5e5.zip |
Bash completions
-rwxr-xr-x | cbt | 8 | ||||
-rwxr-xr-x | completions/cbt | 13 |
2 files changed, 21 insertions, 0 deletions
@@ -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" @@ -108,6 +109,13 @@ log "Find out real path. Build realpath if needed." $* export CBT_HOME=$(dirname $($_DIR/realpath/realpath.sh $0)) + +if [ ! -f /etc/bash_completion.d/cbt ]; then + sudo cp $CBT_HOME/completions/cbt /etc/bash_completion.d/cbt + # reload shell so completions work + exec bash +fi + export NAILGUN=$CBT_HOME/nailgun_launcher/ export TARGET=target/scala-2.11/classes/ mkdir -p $NAILGUN$TARGET diff --git a/completions/cbt b/completions/cbt new file mode 100755 index 0000000..c591321 --- /dev/null +++ b/completions/cbt @@ -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 |