HADOOP-15914. hadoop jar command has no help argument. Contributed by Adam Antal.

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
(cherry picked from commit 9f47a2e4a9845b84cc963708c7924b92df2964f6)
This commit is contained in:
Adam Antal 2019-06-17 22:55:06 -07:00 committed by Wei-Chiu Chuang
parent 0b5bd8e451
commit 2667177248
2 changed files with 9 additions and 0 deletions

View File

@ -139,6 +139,10 @@ function hadoopcmd_case
if [[ -n "${YARN_OPTS}" ]] || [[ -n "${YARN_CLIENT_OPTS}" ]]; then if [[ -n "${YARN_OPTS}" ]] || [[ -n "${YARN_CLIENT_OPTS}" ]]; then
hadoop_error "WARNING: Use \"yarn jar\" to launch YARN applications." hadoop_error "WARNING: Use \"yarn jar\" to launch YARN applications."
fi fi
if [[ -z $1 || $1 = "--help" ]]; then
echo "Usage: hadoop jar <jar> [mainClass] args..."
exit 0
fi
HADOOP_CLASSNAME=org.apache.hadoop.util.RunJar HADOOP_CLASSNAME=org.apache.hadoop.util.RunJar
;; ;;
jnipath) jnipath)

View File

@ -189,6 +189,11 @@ call :updatepath %HADOOP_BIN_PATH%
) else if defined YARN_CLIENT_OPTS ( ) else if defined YARN_CLIENT_OPTS (
@echo WARNING: Use "yarn jar" to launch YARN applications. @echo WARNING: Use "yarn jar" to launch YARN applications.
) )
@rem if --help option is used, no need to call command
if [!hadoop-command-arguments[%1%]!]==["--help"] (
@echo Usage: hadoop jar <jar> [mainClass] args...
goto :eof
)
set CLASS=org.apache.hadoop.util.RunJar set CLASS=org.apache.hadoop.util.RunJar
goto :eof goto :eof