Repository: tajo
Updated Branches:
  refs/heads/index_support 7970ac2d5 -> 567b1c483


TAJO-1145: Add 'bin/tajo --help' command. (Jihun Kang via hyunsik)

Closes #220


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/4b0f6bef
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/4b0f6bef
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/4b0f6bef

Branch: refs/heads/index_support
Commit: 4b0f6befd45348b5b532cfa811c050b9efd9f473
Parents: f728413
Author: Hyunsik Choi <[email protected]>
Authored: Thu Oct 30 20:30:03 2014 -0700
Committer: Hyunsik Choi <[email protected]>
Committed: Thu Oct 30 20:30:03 2014 -0700

----------------------------------------------------------------------
 CHANGES                     |  2 ++
 tajo-dist/src/main/bin/tajo | 13 +++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/4b0f6bef/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a55bf05..9b30787 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,8 @@ Release 0.9.1 - unreleased
 
   IMPROVEMENT
 
+    TAJO-1145: Add 'bin/tajo --help' command. (Jihun Kang via hyunsik)
+
     TAJO-1114: Improve ConfVars (SessionVar) to take a validator 
     interface to check its input. (Jihun Kang via hyunsik)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/4b0f6bef/tajo-dist/src/main/bin/tajo
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/bin/tajo b/tajo-dist/src/main/bin/tajo
index b6091ea..a1bc74a 100755
--- a/tajo-dist/src/main/bin/tajo
+++ b/tajo-dist/src/main/bin/tajo
@@ -58,8 +58,7 @@ case "`uname`" in
 CYGWIN*) cygwin=true;;
 esac
 
-# if no args specified, show usage
-if [ $# = 0 ]; then
+function print_usage() {
   echo "Usage: tajo [--config confdir] COMMAND"
   echo "where COMMAND is one of:"
   echo "  master               run the Master Server"
@@ -76,6 +75,11 @@ if [ $# = 0 ]; then
   echo " or"
   echo "  CLASSNAME            run the class named CLASSNAME"
   echo "Most commands print help when invoked w/o parameters."
+}
+
+# if no args specified, show usage
+if [ $# = 0 ]; then
+  print_usage
   exit 1
 fi
 
@@ -83,6 +87,11 @@ fi
 COMMAND=$1
 shift
 
+if [ "$COMMAND" == "--help" ] || [ "$COMMAND" == "-help" ] || [ "$COMMAND" == 
"-h" ] ; then
+  print_usage
+  exit
+fi
+
 if [ -f "${TAJO_CONF_DIR}/tajo-env.sh" ]; then
   . "${TAJO_CONF_DIR}/tajo-env.sh"
 fi

Reply via email to