Search in sources :

Example 6 with Option

use of org.apache.hbase.thirdparty.org.apache.commons.cli.Option in project hbase by apache.

the class HFileProcedurePrettyPrinter method addOptions.

@Override
protected void addOptions() {
    addOptWithArg("w", "seekToPid", "Seek to this procedure id and print this procedure only");
    OptionGroup files = new OptionGroup();
    files.addOption(new Option("f", "file", true, "File to scan. Pass full-path; e.g. hdfs://a:9000/MasterProcs/master/local/proc/xxx"));
    files.addOption(new Option("a", "all", false, "Scan the whole procedure region."));
    files.setRequired(true);
    options.addOptionGroup(files);
}
Also used : OptionGroup(org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup) Option(org.apache.hbase.thirdparty.org.apache.commons.cli.Option)

Example 7 with Option

use of org.apache.hbase.thirdparty.org.apache.commons.cli.Option in project hbase by apache.

the class DataBlockEncodingTool method printUsage.

private static void printUsage(Options options) {
    System.err.println("Usage:");
    System.err.println(String.format("./hbase %s <options>", DataBlockEncodingTool.class.getName()));
    System.err.println("Options:");
    for (Object it : options.getOptions()) {
        Option opt = (Option) it;
        if (opt.hasArg()) {
            System.err.println(String.format("-%s %s: %s", opt.getOpt(), opt.getArgName(), opt.getDescription()));
        } else {
            System.err.println(String.format("-%s: %s", opt.getOpt(), opt.getDescription()));
        }
    }
}
Also used : Option(org.apache.hbase.thirdparty.org.apache.commons.cli.Option)

Aggregations

Option (org.apache.hbase.thirdparty.org.apache.commons.cli.Option)7 OptionGroup (org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup)2 Collection (java.util.Collection)1 StartTestingClusterOption (org.apache.hadoop.hbase.StartTestingClusterOption)1 CommandLine (org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser)1 GnuParser (org.apache.hbase.thirdparty.org.apache.commons.cli.GnuParser)1 HelpFormatter (org.apache.hbase.thirdparty.org.apache.commons.cli.HelpFormatter)1 Options (org.apache.hbase.thirdparty.org.apache.commons.cli.Options)1