hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1579477 - /hbase/trunk/bin/rolling-restart.sh
Date Thu, 20 Mar 2014 00:01:35 GMT
Author: stack
Date: Thu Mar 20 00:01:35 2014
New Revision: 1579477

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

Modified:
    hbase/trunk/bin/rolling-restart.sh

Modified: hbase/trunk/bin/rolling-restart.sh
URL: http://svn.apache.org/viewvc/hbase/trunk/bin/rolling-restart.sh?rev=1579477&r1=1579476&r2=1579477&view=diff
==============================================================================
--- hbase/trunk/bin/rolling-restart.sh (original)
+++ hbase/trunk/bin/rolling-restart.sh Thu Mar 20 00:01:35 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
       ;;



Mime
View raw message