aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2016-09-17 14:35:23 +0200
committerGitHub <noreply@github.com>2016-09-17 14:35:23 +0200
commit0ec1d01e7c99ee6cea1d7a0be956d1845a3721d6 (patch)
tree757649ac0cf3c034e0984c7922ba5f02a7cb9be2
parente9ae433498e5926e45eaded5934315d51e2edf6a (diff)
parent6a52a4990941983a7befa61ee8c8c15549e80164 (diff)
downloadcbt-0ec1d01e7c99ee6cea1d7a0be956d1845a3721d6.tar.gz
cbt-0ec1d01e7c99ee6cea1d7a0be956d1845a3721d6.tar.bz2
cbt-0ec1d01e7c99ee6cea1d7a0be956d1845a3721d6.zip
Merge pull request #231 from fmcgough/master
Zsh shell completion
-rw-r--r--README.md24
-rwxr-xr-xshell-integration/cbt-completions.zsh7
2 files changed, 28 insertions, 3 deletions
diff --git a/README.md b/README.md
index dd51fae..34eb57c 100644
--- a/README.md
+++ b/README.md
@@ -57,7 +57,7 @@ class Build(val context: cbt.Context) extends PackageJars {
ScalaDependency("com.typesafe.play", "play-json", "2.4.4"),
MavenDependency("joda-time", "joda-time", "2.9.2")
)
-
+
override def compile = {
println("Compiling...")
super.compile
@@ -101,7 +101,7 @@ cbt.BasicBuild.
A folder `build/` can have its own folder `build/` inside in order
to add source or maven dependencies to your build. Eventually
-you'll be able to also choose the CBT and Scala versions for
+you'll be able to also choose the CBT and Scala versions for
target builds. Make sure you extend cbt.BuilBuild instead of
cbt.Build, in order to automatically trigger building of the
target build.
@@ -186,7 +186,7 @@ mkdir ~/.bash_completion.d/
cp shell-integration/cbt-completions.bash ~/.bash_completion.d/
```
-Add this to you .bashrc
+Add this to your .bashrc
```
for f in ~/.bash_completion.d/*; do
source $f
@@ -197,3 +197,21 @@ Fish shell completions
----------------
copy this line into your fish configuration, on OSX: /.config/fish/config.fish
complete -c cbt -a '(cbt taskNames)'
+
+Zsh completions
+---------------
+##### Manual installation
+Add the following to your `.zshrc`
+```
+source /path/to/cbt/shell-integration/cbt-completions.zsh
+```
+##### oh-my-zsh
+If using oh-my-zsh, you can install it as a plugin:
+```
+mkdir ~/.oh-my-zsh/custom/plugins/cbt
+cp shell-integration/cbt-completions.zsh ~/.oh-my-zsh/custom/plugins/cbt/cbt.plugin.zsh
+```
+Then enable it in your `.zshrc`:
+```
+plugins=( ... cbt)
+```
diff --git a/shell-integration/cbt-completions.zsh b/shell-integration/cbt-completions.zsh
new file mode 100755
index 0000000..d11307d
--- /dev/null
+++ b/shell-integration/cbt-completions.zsh
@@ -0,0 +1,7 @@
+#! /usr/bin/env zsh
+
+_cbt() {
+ reply=( "${(ps:\n:)$(cbt taskNames)}" )
+}
+
+compctl -K _cbt cbt