@Test public void testBeginRowHelp() { assertTrue("-b should say it is inclusive", new ScanCommand().getOptions().getOption("b").getDescription().contains("row (inclusive)")); }
@Override public Options getOptions() { final Options o = new Options(); scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations (all user auths are used if this argument is not specified)"); optStartRowExclusive = new Option("be", "begin-exclusive", false, "make start row exclusive (by default it's inclusive)"); optStartRowExclusive.setArgName("begin-exclusive"); optEndRowExclusive = new Option("ee", "end-exclusive", false, "make end row exclusive (by default it's inclusive)"); optEndRowExclusive.setArgName("end-exclusive"); scanOptRow = new Option("r", "row", true, "row to scan"); scanOptColumns = new Option("c", "columns", true, "comma-separated columns"); timestampOpt = new Option("st", "show-timestamps", false, "display timestamps"); disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); showFewOpt = new Option("f", "show-few", true, "show only a specified number of characters"); formatterOpt = new Option("fm", "formatter", true, "fully qualified name of the formatter class to use"); interpreterOpt = new Option("i", "interpreter", true, "fully qualified name of the interpreter class to use"); formatterInterpeterOpt = new Option("fi", "fmt-interpreter", true, "fully qualified name of a class that is a formatter and interpreter"); timeoutOption = new Option(null, "timeout", true, "time before scan should fail if no data is returned. If no unit is" + " given assumes seconds. Units d,h,m,s,and ms are supported. e.g. 30s" + " or 100ms"); outputFileOpt = new Option("o", "output", true, "local file to write the scan output to"); sampleOpt = new Option(null, "sample", false, "Show sample"); contextOpt = new Option("cc", "context", true, "name of the classloader context"); executionHintsOpt = new Option(null, "execution-hints", true, "Execution hints map"); scanOptAuths.setArgName("comma-separated-authorizations"); scanOptRow.setArgName("row"); scanOptColumns .setArgName("<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}"); showFewOpt.setRequired(false); showFewOpt.setArgName("int"); formatterOpt.setArgName("className"); timeoutOption.setArgName("timeout"); outputFileOpt.setArgName("file"); contextOpt.setArgName("context"); executionHintsOpt.setArgName("<key>=<value>{,<key>=<value>}"); profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setArgName("profile"); o.addOption(scanOptAuths); o.addOption(scanOptRow); optStartRowInclusive = new Option(OptUtil.START_ROW_OPT, "begin-row", true, "begin row (inclusive)"); optStartRowInclusive.setArgName("begin-row"); o.addOption(optStartRowInclusive); o.addOption(OptUtil.endRowOpt()); o.addOption(optStartRowExclusive); o.addOption(optEndRowExclusive); o.addOption(scanOptColumns); o.addOption(timestampOpt); o.addOption(disablePaginationOpt); o.addOption(OptUtil.tableOpt("table to be scanned")); o.addOption(showFewOpt); o.addOption(formatterOpt); o.addOption(interpreterOpt); o.addOption(formatterInterpeterOpt); o.addOption(timeoutOption); if (Arrays.asList(new String[] {ScanCommand.class.getName(), GrepCommand.class.getName(), EGrepCommand.class.getName()}).contains(this.getClass().getName())) { o.addOption(outputFileOpt); } o.addOption(profileOpt); o.addOption(sampleOpt); o.addOption(contextOpt); o.addOption(executionHintsOpt); return o; }
ScanCommand extends Command { @Override public Options getOptions() { final Options o = new Options(); scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations (all user auths are used if this argument is not specified)"); optStartRowExclusive = new Option("be", "begin-exclusive", false, "make start row exclusive (by default it's inclusive)"); optStartRowExclusive.setArgName("begin-exclusive"); optEndRowExclusive = new Option("ee", "end-exclusive", false, "make end row exclusive (by default it's inclusive)"); optEndRowExclusive.setArgName("end-exclusive"); scanOptRow = new Option("r", "row", true, "row to scan"); scanOptColumns = new Option("c", "columns", true, "comma-separated columns"); timestampOpt = new Option("st", "show-timestamps", false, "display timestamps"); disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); showFewOpt = new Option("f", "show-few", true, "show only a specified number of characters"); formatterOpt = new Option("fm", "formatter", true, "fully qualified name of the formatter class to use"); interpreterOpt = new Option("i", "interpreter", true, "fully qualified name of the interpreter class to use"); formatterInterpeterOpt = new Option("fi", "fmt-interpreter", true, "fully qualified name of a class that is a formatter and interpreter"); timeoutOption = new Option(null, "timeout", true, "time before scan should fail if no data is returned. If no unit is" + " given assumes seconds. Units d,h,m,s,and ms are supported. e.g. 30s" + " or 100ms"); outputFileOpt = new Option("o", "output", true, "local file to write the scan output to"); sampleOpt = new Option(null, "sample", false, "Show sample"); contextOpt = new Option("cc", "context", true, "name of the classloader context"); executionHintsOpt = new Option(null, "execution-hints", true, "Execution hints map"); scanOptAuths.setArgName("comma-separated-authorizations"); scanOptRow.setArgName("row"); scanOptColumns .setArgName("<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}"); showFewOpt.setRequired(false); showFewOpt.setArgName("int"); formatterOpt.setArgName("className"); timeoutOption.setArgName("timeout"); outputFileOpt.setArgName("file"); contextOpt.setArgName("context"); executionHintsOpt.setArgName("<key>=<value>{,<key>=<value>}"); profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setArgName("profile"); o.addOption(scanOptAuths); o.addOption(scanOptRow); optStartRowInclusive = new Option(OptUtil.START_ROW_OPT, "begin-row", true, "begin row (inclusive)"); optStartRowInclusive.setArgName("begin-row"); o.addOption(optStartRowInclusive); o.addOption(OptUtil.endRowOpt()); o.addOption(optStartRowExclusive); o.addOption(optEndRowExclusive); o.addOption(scanOptColumns); o.addOption(timestampOpt); o.addOption(disablePaginationOpt); o.addOption(OptUtil.tableOpt("table to be scanned")); o.addOption(showFewOpt); o.addOption(formatterOpt); o.addOption(interpreterOpt); o.addOption(formatterInterpeterOpt); o.addOption(timeoutOption); if (Arrays.asList(new String[] {ScanCommand.class.getName(), GrepCommand.class.getName(), EGrepCommand.class.getName()}).contains(this.getClass().getName())) { o.addOption(outputFileOpt); } o.addOption(profileOpt); o.addOption(sampleOpt); o.addOption(contextOpt); o.addOption(executionHintsOpt); return o; } }
ScanCommand extends Command { @Override public Options getOptions() { final Options o = new Options(); scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations (all user auths are used if this argument is not specified)"); optStartRowExclusive = new Option("be", "begin-exclusive", false, "make start row exclusive (by default it's inclusive)"); optStartRowExclusive.setArgName("begin-exclusive"); optEndRowExclusive = new Option("ee", "end-exclusive", false, "make end row exclusive (by default it's inclusive)"); optEndRowExclusive.setArgName("end-exclusive"); scanOptRow = new Option("r", "row", true, "row to scan"); scanOptColumns = new Option("c", "columns", true, "comma-separated columns"); timestampOpt = new Option("st", "show-timestamps", false, "display timestamps"); disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); showFewOpt = new Option("f", "show-few", true, "show only a specified number of characters"); formatterOpt = new Option("fm", "formatter", true, "fully qualified name of the formatter class to use"); interpreterOpt = new Option("i", "interpreter", true, "fully qualified name of the interpreter class to use"); formatterInterpeterOpt = new Option("fi", "fmt-interpreter", true, "fully qualified name of a class that is a formatter and interpreter"); timeoutOption = new Option(null, "timeout", true, "time before scan should fail if no data is returned. If no unit is" + " given assumes seconds. Units d,h,m,s,and ms are supported. e.g. 30s" + " or 100ms"); outputFileOpt = new Option("o", "output", true, "local file to write the scan output to"); sampleOpt = new Option(null, "sample", false, "Show sample"); contextOpt = new Option("cc", "context", true, "name of the classloader context"); executionHintsOpt = new Option(null, "execution-hints", true, "Execution hints map"); scanOptAuths.setArgName("comma-separated-authorizations"); scanOptRow.setArgName("row"); scanOptColumns .setArgName("<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}"); showFewOpt.setRequired(false); showFewOpt.setArgName("int"); formatterOpt.setArgName("className"); timeoutOption.setArgName("timeout"); outputFileOpt.setArgName("file"); contextOpt.setArgName("context"); executionHintsOpt.setArgName("<key>=<value>{,<key>=<value>}"); profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setArgName("profile"); o.addOption(scanOptAuths); o.addOption(scanOptRow); optStartRowInclusive = new Option(OptUtil.START_ROW_OPT, "begin-row", true, "begin row (inclusive)"); optStartRowInclusive.setArgName("begin-row"); o.addOption(optStartRowInclusive); o.addOption(OptUtil.endRowOpt()); o.addOption(optStartRowExclusive); o.addOption(optEndRowExclusive); o.addOption(scanOptColumns); o.addOption(timestampOpt); o.addOption(disablePaginationOpt); o.addOption(OptUtil.tableOpt("table to be scanned")); o.addOption(showFewOpt); o.addOption(formatterOpt); o.addOption(interpreterOpt); o.addOption(formatterInterpeterOpt); o.addOption(timeoutOption); if (Arrays.asList(new String[] {ScanCommand.class.getName(), GrepCommand.class.getName(), EGrepCommand.class.getName()}).contains(this.getClass().getName())) { o.addOption(outputFileOpt); } o.addOption(profileOpt); o.addOption(sampleOpt); o.addOption(contextOpt); o.addOption(executionHintsOpt); return o; }  }
ScanCommand extends Command { @Override public Options getOptions() { final Options o = new Options(); scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations (all user auths are used if this argument is not specified)"); optStartRowExclusive = new Option("be", "begin-exclusive", false, "make start row exclusive (by default it's inclusive)"); optStartRowExclusive.setArgName("begin-exclusive"); optEndRowExclusive = new Option("ee", "end-exclusive", false, "make end row exclusive (by default it's inclusive)"); optEndRowExclusive.setArgName("end-exclusive"); scanOptRow = new Option("r", "row", true, "row to scan"); scanOptColumns = new Option("c", "columns", true, "comma-separated columns"); timestampOpt = new Option("st", "show-timestamps", false, "display timestamps"); disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); showFewOpt = new Option("f", "show-few", true, "show only a specified number of characters"); formatterOpt = new Option("fm", "formatter", true, "fully qualified name of the formatter class to use"); interpreterOpt = new Option("i", "interpreter", true, "fully qualified name of the interpreter class to use"); formatterInterpeterOpt = new Option("fi", "fmt-interpreter", true, "fully qualified name of a class that is a formatter and interpreter"); timeoutOption = new Option(null, "timeout", true, "time before scan should fail if no data is returned. If no unit is" + " given assumes seconds. Units d,h,m,s,and ms are supported. e.g. 30s" + " or 100ms"); outputFileOpt = new Option("o", "output", true, "local file to write the scan output to"); sampleOpt = new Option(null, "sample", false, "Show sample"); contextOpt = new Option("cc", "context", true, "name of the classloader context"); executionHintsOpt = new Option(null, "execution-hints", true, "Execution hints map"); scanOptAuths.setArgName("comma-separated-authorizations"); scanOptRow.setArgName("row"); scanOptColumns .setArgName("<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}"); showFewOpt.setRequired(false); showFewOpt.setArgName("int"); formatterOpt.setArgName("className"); timeoutOption.setArgName("timeout"); outputFileOpt.setArgName("file"); contextOpt.setArgName("context"); executionHintsOpt.setArgName("<key>=<value>{,<key>=<value>}"); profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setArgName("profile"); o.addOption(scanOptAuths); o.addOption(scanOptRow); optStartRowInclusive = new Option(OptUtil.START_ROW_OPT, "begin-row", true, "begin row (inclusive)"); optStartRowInclusive.setArgName("begin-row"); o.addOption(optStartRowInclusive); o.addOption(OptUtil.endRowOpt()); o.addOption(optStartRowExclusive); o.addOption(optEndRowExclusive); o.addOption(scanOptColumns); o.addOption(timestampOpt); o.addOption(disablePaginationOpt); o.addOption(OptUtil.tableOpt("table to be scanned")); o.addOption(showFewOpt); o.addOption(formatterOpt); o.addOption(interpreterOpt); o.addOption(formatterInterpeterOpt); o.addOption(timeoutOption); if (Arrays.asList(new String[] {ScanCommand.class.getName(), GrepCommand.class.getName(), EGrepCommand.class.getName()}).contains(this.getClass().getName())) { o.addOption(outputFileOpt); } o.addOption(profileOpt); o.addOption(sampleOpt); o.addOption(contextOpt); o.addOption(executionHintsOpt); return o; }  @Override int execute(final String fullCommand, final CommandLine cl, final Shell shellState); @Override String description(); @Override Options getOptions(); @Override int numArgs(); }
ScanCommand extends Command { @Override public Options getOptions() { final Options o = new Options(); scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations (all user auths are used if this argument is not specified)"); optStartRowExclusive = new Option("be", "begin-exclusive", false, "make start row exclusive (by default it's inclusive)"); optStartRowExclusive.setArgName("begin-exclusive"); optEndRowExclusive = new Option("ee", "end-exclusive", false, "make end row exclusive (by default it's inclusive)"); optEndRowExclusive.setArgName("end-exclusive"); scanOptRow = new Option("r", "row", true, "row to scan"); scanOptColumns = new Option("c", "columns", true, "comma-separated columns"); timestampOpt = new Option("st", "show-timestamps", false, "display timestamps"); disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); showFewOpt = new Option("f", "show-few", true, "show only a specified number of characters"); formatterOpt = new Option("fm", "formatter", true, "fully qualified name of the formatter class to use"); interpreterOpt = new Option("i", "interpreter", true, "fully qualified name of the interpreter class to use"); formatterInterpeterOpt = new Option("fi", "fmt-interpreter", true, "fully qualified name of a class that is a formatter and interpreter"); timeoutOption = new Option(null, "timeout", true, "time before scan should fail if no data is returned. If no unit is" + " given assumes seconds. Units d,h,m,s,and ms are supported. e.g. 30s" + " or 100ms"); outputFileOpt = new Option("o", "output", true, "local file to write the scan output to"); sampleOpt = new Option(null, "sample", false, "Show sample"); contextOpt = new Option("cc", "context", true, "name of the classloader context"); executionHintsOpt = new Option(null, "execution-hints", true, "Execution hints map"); scanOptAuths.setArgName("comma-separated-authorizations"); scanOptRow.setArgName("row"); scanOptColumns .setArgName("<columnfamily>[:<columnqualifier>]{,<columnfamily>[:<columnqualifier>]}"); showFewOpt.setRequired(false); showFewOpt.setArgName("int"); formatterOpt.setArgName("className"); timeoutOption.setArgName("timeout"); outputFileOpt.setArgName("file"); contextOpt.setArgName("context"); executionHintsOpt.setArgName("<key>=<value>{,<key>=<value>}"); profileOpt = new Option("pn", "profile", true, "iterator profile name"); profileOpt.setArgName("profile"); o.addOption(scanOptAuths); o.addOption(scanOptRow); optStartRowInclusive = new Option(OptUtil.START_ROW_OPT, "begin-row", true, "begin row (inclusive)"); optStartRowInclusive.setArgName("begin-row"); o.addOption(optStartRowInclusive); o.addOption(OptUtil.endRowOpt()); o.addOption(optStartRowExclusive); o.addOption(optEndRowExclusive); o.addOption(scanOptColumns); o.addOption(timestampOpt); o.addOption(disablePaginationOpt); o.addOption(OptUtil.tableOpt("table to be scanned")); o.addOption(showFewOpt); o.addOption(formatterOpt); o.addOption(interpreterOpt); o.addOption(formatterInterpeterOpt); o.addOption(timeoutOption); if (Arrays.asList(new String[] {ScanCommand.class.getName(), GrepCommand.class.getName(), EGrepCommand.class.getName()}).contains(this.getClass().getName())) { o.addOption(outputFileOpt); } o.addOption(profileOpt); o.addOption(sampleOpt); o.addOption(contextOpt); o.addOption(executionHintsOpt); return o; }  @Override int execute(final String fullCommand, final CommandLine cl, final Shell shellState); @Override String description(); @Override Options getOptions(); @Override int numArgs();  }