Skip to content

Commit f660e5e

Browse files
HDFS-14163. Debug Admin Command Should Support Generic Options. Contributed by Ayush Saxena.
1 parent 21fe77e commit f660e5e

File tree

1 file changed

+6
-2
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools

1 file changed

+6
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DebugAdmin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import org.apache.hadoop.util.DataChecksum;
5252
import org.apache.hadoop.util.StringUtils;
5353
import org.apache.hadoop.util.Tool;
54+
import org.apache.hadoop.util.ToolRunner;
5455

5556
/**
5657
* This class implements debug operations on the HDFS command-line.
@@ -458,11 +459,14 @@ private void printUsage() {
458459
if (!command.name.equals("help")) {
459460
System.out.println(command.usageText);
460461
}
462+
System.out.println();
463+
ToolRunner.printGenericCommandUsage(System.out);
461464
}
462465
}
463466

464-
public static void main(String[] argsArray) throws IOException {
467+
public static void main(String[] argsArray) throws Exception {
465468
DebugAdmin debugAdmin = new DebugAdmin(new Configuration());
466-
System.exit(debugAdmin.run(argsArray));
469+
int res = ToolRunner.run(debugAdmin, argsArray);
470+
System.exit(res);
467471
}
468472
}

0 commit comments

Comments
 (0)