Bläddra i källkod

HDFS-14691. Wrong usage hint for hadoop fs command "test".

Contributed by Jianfei Jiang.

Change-Id: I9f5e89721ff210641375fbf42a70043f0d74458e
Jianfei Jiang 5 år sedan
förälder
incheckning
71aad60e51

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Test.java

@@ -39,7 +39,7 @@ class Test extends FsCommand {
   }
 
   public static final String NAME = "test";
-  public static final String USAGE = "-[defsz] <path>";
+  public static final String USAGE = "-[defswrz] <path>";
   public static final String DESCRIPTION =
       "Answer various questions about <path>, with result via exit status.\n"
           + "  -d  return 0 if <path> is a directory.\n"

+ 2 - 2
hadoop-common-project/hadoop-common/src/site/markdown/FileSystemShell.md

@@ -733,7 +733,7 @@ Exit Code: Returns 0 on success and -1 on error.
 test
 ----
 
-Usage: `hadoop fs -test -[defsz] URI`
+Usage: `hadoop fs -test -[defswrz] URI`
 
 Options:
 
@@ -741,8 +741,8 @@ Options:
 * -e: if the path exists, return 0.
 * -f: if the path is a file, return 0.
 * -s: if the path is not empty, return 0.
-* -r: if the path exists and read permission is granted, return 0.
 * -w: if the path exists and write permission is granted, return 0.
+* -r: if the path exists and read permission is granted, return 0.
 * -z: if the file is zero length, return 0.
 
 

+ 2 - 2
hadoop-common-project/hadoop-common/src/test/resources/testConf.xml

@@ -923,7 +923,7 @@
       <comparators>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^-test -\[defsz\] &lt;path&gt; :\s*</expected-output>
+          <expected-output>^-test -\[defswrz\] &lt;path&gt; :\s*</expected-output>
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
@@ -931,7 +931,7 @@
         </comparator>
         <comparator>
           <type>RegexpComparator</type>
-          <expected-output>^\s*-[defsz]\s+return 0 if .*</expected-output>
+          <expected-output>^\s*-[defswrz]\s+return 0 if .*</expected-output>
         </comparator>
       </comparators>
     </test>