summaryrefslogtreecommitdiff
path: root/buildstream/data
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-08-27 17:29:08 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-08-28 02:48:07 -0400
commit25caabb2e9ae6548e452eff1bdabeeb23386e1ab (patch)
treec1f03121422368682a4f3df1c82b0d8118c9f82d /buildstream/data
parent9890d1a8827d894d67f0e3a31b443f13becb1e3b (diff)
downloadbuildstream-25caabb2e9ae6548e452eff1bdabeeb23386e1ab.tar.gz
buildstream/data/bst: Adding a bash completion scriptlet.
Currently this gets installed at ${prefix}/share/bash-completion/completions but this is not exactly correct.
Diffstat (limited to 'buildstream/data')
-rw-r--r--buildstream/data/bst21
1 files changed, 21 insertions, 0 deletions
diff --git a/buildstream/data/bst b/buildstream/data/bst
new file mode 100644
index 000000000..a71f6d3fd
--- /dev/null
+++ b/buildstream/data/bst
@@ -0,0 +1,21 @@
+# BuildStream bash completion scriptlet.
+#
+# On systems which use the bash-completion module for
+# completion discovery with bash, this can be installed at:
+#
+# pkg-config --variable=completionsdir bash-completion
+#
+# If BuildStream is not installed system wide, you can
+# simply source this script to enable completions or append
+# this script to your ~/.bash_completions.
+#
+_bst_completion() {
+ local IFS=$'
+'
+ COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
+ COMP_CWORD=$COMP_CWORD \
+ _BST_COMPLETION=complete $1 ) )
+ return 0
+}
+
+complete -F _bst_completion -o nospace bst;