You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2019/06/18 05:56:37 UTC

[hadoop] branch branch-3.2 updated: HADOOP-15914. hadoop jar command has no help argument. Contributed by Adam Antal.

This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new 2667177  HADOOP-15914. hadoop jar command has no help argument. Contributed by Adam Antal.
2667177 is described below

commit 26671772486b71f27ba37c836006b4ab05fd2b96
Author: Adam Antal <ad...@cloudera.com>
AuthorDate: Mon Jun 17 22:55:06 2019 -0700

    HADOOP-15914. hadoop jar command has no help argument. Contributed by Adam Antal.
    
    Signed-off-by: Wei-Chiu Chuang <we...@apache.org>
    (cherry picked from commit 9f47a2e4a9845b84cc963708c7924b92df2964f6)
---
 hadoop-common-project/hadoop-common/src/main/bin/hadoop     | 4 ++++
 hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop
index fa78ec3..882c858 100755
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop
@@ -139,6 +139,10 @@ function hadoopcmd_case
       if [[ -n "${YARN_OPTS}" ]] || [[ -n "${YARN_CLIENT_OPTS}" ]]; then
         hadoop_error "WARNING: Use \"yarn jar\" to launch YARN applications."
       fi
+      if [[ -z $1 || $1 = "--help" ]]; then
+        echo "Usage: hadoop jar <jar> [mainClass] args..."
+        exit 0
+      fi
       HADOOP_CLASSNAME=org.apache.hadoop.util.RunJar
     ;;
     jnipath)
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd b/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
index 91c65d1..04e5039 100644
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
@@ -189,6 +189,11 @@ call :updatepath %HADOOP_BIN_PATH%
   ) else if defined YARN_CLIENT_OPTS (
     @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
   goto :eof
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org