HBASE-10797 Add support for -h and --help to rolling_restart.sh and fix the usage string output

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1579477 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2014-03-20 00:01:35 +00:00
parent 7278d9ccf1
commit 8b00ce12bf
1 changed files with 10 additions and 8 deletions

View File

@ -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
;;