Index: bin/rolling-restart.sh =================================================================== --- bin/rolling-restart.sh (revision 1579464) +++ bin/rolling-restart.sh (working copy) @@ -34,8 +34,12 @@ # # Modelled after $HADOOP_HOME/bin/slaves.sh. -usage="Usage: $0 [--config ] [--rs-only] [--master-only] [--graceful] [--maxthreads xx]" +usage_str="Usage: `basename $0` [--config ] [--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 @@ exit $errCode fi -function usage() { - echo $usage - exit 1 -} - - RR_RS=1 RR_MASTER=1 RR_GRACEFUL=0 @@ -84,8 +82,12 @@ RR_MAXTHREADS=$1 shift ;; + --help|-h) + usage + exit 0 + ;; *) - echo Bad argument: $x + echo Bad argument: $1 usage exit 1 ;;