Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 91 lines (76 sloc) 2.14 KB
#!/bin/sh
VERSION="0.2.0"
# content location
program=`basename $0`
hubris_dir="`dirname $0`"
hubris_dir=`echo $hubris_dir | sed 's/\/bin//'`
hubris_jar_standalone="$hubris_dir/hubris-$VERSION-standalone.jar"
hubris_jar_plain="$hubris_dir/hubris-$VERSION.jar"
# rlwrap stuff
RLWRAP=`which rlwrap`
breakchars="(){}[],^%$#@\"\";:''|\\"
help() {
cat <<EOF
Usage: $program [OPTIONS]
$program is a Hbase UBeR Interactive Shell
Options:
--help this help
--version show version
--clojure go directly in clojure mode
--debug display various details from hbase logger and $program
Environment:
HUBRIS_DEBUG run hubris in debug mode (same as --debug option)
HUBRIS_LIB alternative location for additional jars
CLASSPATH additional classes and jars explicitly exported
EOF
}
if test $# -ne 0; then
case $1 in
"--help")
help
exit 0
;;
"--version")
echo $VERSION
exit 0
;;
"--clojure")
clojure_mode="true"
;;
"--debug")
export HUBRIS_DEBUG=1
;;
*)
echo "Unknown option. Run '$program --help' for all options."
exit 1
esac
fi
# find and resolve dependencies first in default directory or user set HUBRIS_LIB environmnet var
if test "x$HUBRIS_LIB" = "x"; then
HUBRIS_LIB="$hubris_dir/lib"
fi
# pick user selected classes
CLASSES="$CLASSPATH"
if test -d "$HUBRIS_LIB"; then
CLASSES=":`find $HUBRIS_LIB -name "*.jar" | sort | tr '\n' ':'`"
fi
# resolve what kind of our jar to use; the big one (standalone) or the little one
if test -f $hubris_jar_standalone; then
hubris_jar=$hubris_jar_standalone
else
if test -f $hubris_jar_plain; then
hubris_jar=$hubris_jar_plain
else
echo "Unable to find application jar file. Did you compiled $program???"
exit 1
fi
fi
CLASSES="$CLASSES:$hubris_jar"
if test "x$RLWRAP" != "x"; then
[ "x$HUBRIS_DEBUG" = "x1" ] && echo "Using rlwrap..."
COMMAND="$RLWRAP --remember -c -b $breakchars -f $hubris_dir/utils/completions"
else
[ "x$HUBRIS_DEBUG" = "x1" ] && echo "NOT using rlwrap..."
COMMAND=""
fi
$COMMAND java -cp $CLASSES hubris.core $clojure_mode
Jump to Line
Something went wrong with that request. Please try again.