HBASE-5823 Hbck should be able to print help

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1327638 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-04-18 19:31:28 +00:00
parent 5446911066
commit b196f98194
1 changed files with 7 additions and 1 deletions

View File

@ -2894,6 +2894,7 @@ public class HBaseFsck {
protected static void printUsageAndExit() {
System.err.println("Usage: fsck [opts] {only tables}");
System.err.println(" where [opts] are:");
System.err.println(" -help Display help options (this)");
System.err.println(" -details Display full report of all regions.");
System.err.println(" -timelag {timeInSeconds} Process only regions that " +
" have not experienced any metadata updates in the last " +
@ -2938,7 +2939,9 @@ public class HBaseFsck {
// Process command-line args.
for (int i = 0; i < args.length; i++) {
String cmd = args[i];
if (cmd.equals("-details")) {
if (cmd.equals("-help") || cmd.equals("-h")) {
printUsageAndExit();
} else if (cmd.equals("-details")) {
fsck.setDisplayFullReport();
} else if (cmd.equals("-timelag")) {
if (i == args.length - 1) {
@ -3031,6 +3034,9 @@ public class HBaseFsck {
fsck.setSummary();
} else if (cmd.equals("-metaonly")) {
fsck.setCheckMetaOnly();
} else if (cmd.startsWith("-")) {
System.err.println("Unrecognized option:" + cmd);
printUsageAndExit();
} else {
byte[] table = Bytes.toBytes(cmd);
fsck.includeTable(table);