You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2014/03/20 01:02:08 UTC

svn commit: r1579480 - /hbase/branches/0.96/bin/rolling-restart.sh

Author: stack
Date: Thu Mar 20 00:02:08 2014
New Revision: 1579480

URL: http://svn.apache.org/r1579480
Log:
HBASE-10797 Add support for -h and --help to rolling_restart.sh and fix the usage string output

Modified:
    hbase/branches/0.96/bin/rolling-restart.sh

Modified: hbase/branches/0.96/bin/rolling-restart.sh
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/bin/rolling-restart.sh?rev=1579480&r1=1579479&r2=1579480&view=diff
==============================================================================
--- hbase/branches/0.96/bin/rolling-restart.sh (original)
+++ hbase/branches/0.96/bin/rolling-restart.sh Thu Mar 20 00:02:08 2014
@@ -34,7 +34,11 @@
 #
 # Modelled after $HADOOP_HOME/bin/slaves.sh.
 
-usage="Usage: $0 [--config <hbase-confdir>] [--rs-only] [--master-only] [--graceful] [--maxthreads xx]"
+usage_str="Usage: `basename $0` [--config <hbase-confdir>] [--rs-only] [--master-only] [--graceful] [--maxthreads xx]"
+
+function usage() {
+  echo "${usage_str}"
+}
 
 bin=`dirname "$0"`
 bin=`cd "$bin">/dev/null; pwd`
@@ -48,12 +52,6 @@ then
   exit $errCode
 fi
 
-function usage() {
-  echo $usage
-  exit 1
-}
-
-
 RR_RS=1
 RR_MASTER=1
 RR_GRACEFUL=0
@@ -84,8 +82,12 @@ while [ $# -gt 0 ]; do
       RR_MAXTHREADS=$1
       shift
       ;;
+    --help|-h)
+      usage
+      exit 0
+      ;;
     *)
-      echo Bad argument: $x
+      echo Bad argument: $1
       usage
       exit 1
       ;;