aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rwxr-xr-xshell-integration/cbt-completions.bash2
-rw-r--r--shell-integration/cbt-completions.fish1
-rw-r--r--stage2/BasicBuild.scala2
4 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 2f2134b..dd51fae 100644
--- a/README.md
+++ b/README.md
@@ -192,3 +192,8 @@ for f in ~/.bash_completion.d/*; do
source $f
done
```
+
+Fish shell completions
+----------------
+copy this line into your fish configuration, on OSX: /.config/fish/config.fish
+complete -c cbt -a '(cbt taskNames)'
diff --git a/shell-integration/cbt-completions.bash b/shell-integration/cbt-completions.bash
index c591321..925ba4b 100755
--- a/shell-integration/cbt-completions.bash
+++ b/shell-integration/cbt-completions.bash
@@ -5,7 +5,7 @@ __cbt()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
- opts="$(cbt usage)"
+ opts="$(cbt taskNames)"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
diff --git a/shell-integration/cbt-completions.fish b/shell-integration/cbt-completions.fish
new file mode 100644
index 0000000..6e543fb
--- /dev/null
+++ b/shell-integration/cbt-completions.fish
@@ -0,0 +1 @@
+complete -c cbt -a (cbt taskNames)
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala
index 410d68f..b2bb72b 100644
--- a/stage2/BasicBuild.scala
+++ b/stage2/BasicBuild.scala
@@ -25,6 +25,8 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge
final def projectDirectory: File = lib.realpath(context.projectDirectory)
assert( projectDirectory.exists, "projectDirectory does not exist: " ++ projectDirectory.string )
final def usage: String = lib.usage(this.getClass, show)
+
+ final def taskNames: String = lib.taskNames(this.getClass).sorted.mkString("\n")
// ========== meta data ==========