aboutsummaryrefslogtreecommitdiff
path: root/beam.in
diff options
context:
space:
mode:
Diffstat (limited to 'beam.in')
-rw-r--r--beam.in58
1 files changed, 58 insertions, 0 deletions
diff --git a/beam.in b/beam.in
new file mode 100644
index 0000000..187cc13
--- /dev/null
+++ b/beam.in
@@ -0,0 +1,58 @@
+#! /bin/bash
+
+libdir=@LIBDIR@/bbe
+set -e
+. $libdir/common.sh
+set +e
+
+help() {
+ cat <<EOT
+usage: bbe COMMAND [OPTIONS] [ITEM [ITEM...]]
+
+COMMANDS are:
+EOT
+ for cmd in @LIBEXECDIR@/bbe-*
+ do
+ test -x $cmd && $cmd --wtf
+ done
+ wtf help display help page for a particular command
+ echo ""
+ echo "Report bugs to <@PACKAGE_BUGREPORT@>"
+ exit 0
+}
+
+while [ $# -ne 0 ]
+do
+ case $1 in
+ -h|--help) help;;
+ -V|--version) print_version;;
+ --) shift; break;;
+ -*) echo >&2 "$0: unrecognized option $1"; exit 1;;
+ *) break;;
+ esac
+ shift
+done
+
+if [ $# -eq 0 ]; then
+ error "command not specified"
+ abend 1 "try $0 --help for more details"
+fi
+
+if [ $1 = "help" ]; then
+ shift
+ if [ $# -eq 0 ]; then
+ man 1 beam
+ else
+ man 1 beam-$1
+ fi
+ exit $?
+fi
+
+if [ -x @LIBEXECDIR@/beam-$1 ]; then
+ cmd=@LIBEXECDIR@/beam-$1
+ shift
+ $cmd $@
+else
+ error "unknown command"
+ abend 1 "try $0 --help for more details"
+fi

Return to:

Send suggestions and report system problems to the System administrator.