aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md16
-rwxr-xr-xcbt7
-rwxr-xr-xshell-integration/cbt-completions.bash (renamed from completions/cbt)0
3 files changed, 16 insertions, 7 deletions
diff --git a/README.md b/README.md
index 7a1174e..2f2134b 100644
--- a/README.md
+++ b/README.md
@@ -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
+```
diff --git a/cbt b/cbt
index 2ec9ccf..5751e69 100755
--- a/cbt
+++ b/cbt
@@ -109,13 +109,6 @@ 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/shell-integration/cbt-completions.bash
index c591321..c591321 100755
--- a/completions/cbt
+++ b/shell-integration/cbt-completions.bash