summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorChandan Singh <git@chandansingh.net>2018-02-17 01:53:52 +0000
committerChandan Singh <git@chandansingh.net>2018-02-17 02:09:19 +0000
commite8de57f975de0d04d9cb9f2f676db55c1b80543c (patch)
tree6b39ffe49abe9c4208d8a7cd00c60cf136c13457 /contrib
parent722045dbf335cae02ac203fc810933657b044662 (diff)
downloadbuildstream-e8de57f975de0d04d9cb9f2f676db55c1b80543c.tar.gz
bst-here: add usage instructions
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/bst-here26
1 files changed, 25 insertions, 1 deletions
diff --git a/contrib/bst-here b/contrib/bst-here
index b96b36cdc..b8c2dd772 100755
--- a/contrib/bst-here
+++ b/contrib/bst-here
@@ -22,6 +22,25 @@
# This is a helper script for using BuildStream via Docker. See
# docs/source/install.rst for documentation.
+usage() {
+ cat <<EOF
+
+USAGE: $(basename "$0") [-t] [-T] [-h] [COMMAND] [ARG..]
+
+Run a bst command in a new BuildStream contaner.
+
+If no command is specified, an interactive shell is launched
+using "/bin/bash -i".
+
+OPTIONS:
+ -t Force pseudo-terminal allocation.
+ -T Disable pseudo-terminal allocation.
+ -h Print this help text and exit.
+
+EOF
+ exit "$1"
+}
+
is_tty=
if test -t 0
@@ -29,7 +48,7 @@ then
is_tty=y
fi
-while getopts tT arg
+while getopts tTh arg
do
case $arg in
T)
@@ -38,6 +57,11 @@ do
t)
is_tty=y
;;
+ h)
+ usage 0
+ ;;
+ \?)
+ usage 1
esac
done