|
@@ -53,13 +53,7 @@ DEFAULT_LIBEXEC_DIR="$bin"/../libexec
|
|
|
HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
|
|
|
. $HADOOP_LIBEXEC_DIR/yarn-config.sh
|
|
|
|
|
|
-cygwin=false
|
|
|
-case "`uname`" in
|
|
|
-CYGWIN*) cygwin=true;;
|
|
|
-esac
|
|
|
-
|
|
|
-# if no args specified, show usage
|
|
|
-if [ $# = 0 ]; then
|
|
|
+function print_usage(){
|
|
|
echo "Usage: yarn [--config confdir] COMMAND"
|
|
|
echo "where COMMAND is one of:"
|
|
|
echo " resourcemanager run the ResourceManager"
|
|
@@ -76,6 +70,16 @@ if [ $# = 0 ]; then
|
|
|
echo " or"
|
|
|
echo " CLASSNAME run the class named CLASSNAME"
|
|
|
echo "Most commands print help when invoked w/o parameters."
|
|
|
+}
|
|
|
+
|
|
|
+cygwin=false
|
|
|
+case "`uname`" in
|
|
|
+CYGWIN*) cygwin=true;;
|
|
|
+esac
|
|
|
+
|
|
|
+# if no args specified, show usage
|
|
|
+if [ $# = 0 ]; then
|
|
|
+ print_usage
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
@@ -83,6 +87,14 @@ fi
|
|
|
COMMAND=$1
|
|
|
shift
|
|
|
|
|
|
+case $COMMAND in
|
|
|
+ # usage flags
|
|
|
+ --help|-help|-h)
|
|
|
+ print_usage
|
|
|
+ exit
|
|
|
+ ;;
|
|
|
+esac
|
|
|
+
|
|
|
if [ -f "${YARN_CONF_DIR}/yarn-env.sh" ]; then
|
|
|
. "${YARN_CONF_DIR}/yarn-env.sh"
|
|
|
fi
|