From b196f98194bf32b8fc89e8a0ced68cc6e09ba571 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 18 Apr 2012 19:31:28 +0000 Subject: [PATCH] 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 --- src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java index 61f81280ecf..66156c2891c 100644 --- a/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java +++ b/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java @@ -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);