List of usage examples for org.apache.commons.cli HelpFormatter setArgName
public void setArgName(String name)
From source file:com.genentech.chemistry.openEye.apps.SDFCatsIndexer.java
private static void exitWithHelp(Options options) { int width = 100; String start = MY_NAME;/*from w ww . j a v a 2s .co m*/ String head = "Will generate CATS Fingerprints for input compounds."; HelpFormatter formatter = new HelpFormatter(); formatter.setArgName("p"); PrintWriter out = new PrintWriter(System.err, true); formatter.printUsage(out, width, start, options); formatter.printWrapped(out, width, head); formatter.printOptions(out, width, options, 2, 2); System.exit(1); }
From source file:com.esri.geoevent.test.performance.OrchestratorMain.java
private static void printHelp(Options testHarnessOptions) { HelpFormatter formatter = new HelpFormatter(); formatter.setLongOptPrefix("-"); formatter.setArgName("value"); formatter.setWidth(100);// w w w. ja v a2s. c om // do not sort the options in any order formatter.setOptionComparator(new Comparator<Option>() { @Override public int compare(Option o1, Option o2) { return 0; } }); formatter.printHelp(ImplMessages.getMessage("ORCHESTRATOR_EXECUTOR_HELP_TITLE_MSG"), testHarnessOptions, true); System.out.println(""); }
From source file:com.genentech.chemistry.openEye.apps.SDFTopologicalIndexer.java
private static void exitWithHelp(Options options) { int width = 100; StringBuilder types = new StringBuilder(); types.append("'all' or one or multiple of: "); for (String typ : AVAILIndexes) types.append(typ).append(" "); String start = MY_NAME + " all|IndexTypes"; String head = "Will generate topological indexes for input compounds."; HelpFormatter formatter = new HelpFormatter(); formatter.setArgName("p"); PrintWriter out = new PrintWriter(System.err, true); formatter.printUsage(out, width, start, options); formatter.printWrapped(out, width, head); formatter.printOptions(out, width, options, 2, 2); formatter.printWrapped(out, width, 18, " IndexTypes: " + types.toString()); System.exit(1);/*from ww w . ja v a 2 s . co m*/ }
From source file:com.esri.geoevent.test.performance.ConsumerMain.java
private static void printHelp(Options performerOptions) { HelpFormatter formatter = new HelpFormatter(); formatter.setLongOptPrefix("-"); formatter.setArgName("value"); formatter.setWidth(100);/*from w w w. j a v a 2s .c om*/ // do not sort the options in any order formatter.setOptionComparator(new Comparator<Option>() { @Override public int compare(Option o1, Option o2) { return 0; } }); formatter.printHelp(ImplMessages.getMessage("CONSUMER_EXECUTOR_HELP_TITLE_MSG"), performerOptions, true); System.out.println(""); }
From source file:com.esri.geoevent.test.performance.ProducerMain.java
private static void printHelp(Options performerOptions) { HelpFormatter formatter = new HelpFormatter(); formatter.setLongOptPrefix("-"); formatter.setArgName("value"); formatter.setWidth(100);//from w ww. j a v a 2 s . co m // do not sort the options in any order formatter.setOptionComparator(new Comparator<Option>() { @Override public int compare(Option o1, Option o2) { return 0; } }); formatter.printHelp(ImplMessages.getMessage("PRODUCER_EXECUTOR_HELP_TITLE_MSG"), performerOptions, true); System.out.println(""); }
From source file:com.ning.metrics.event.loader.EventLoaderConfiguration.java
public static void usage() { HelpFormatter formatter = new HelpFormatter(); formatter.setArgName("PATH"); log.info("eventExport [OPTION]... EVENT_TYPE PATH...," + options); }
From source file:com.eucalyptus.upgrade.TestHarness.java
@SuppressWarnings({ "static-access" }) private static void printHelp(Options opts) { try {/*from ww w . j a va 2s . c om*/ PrintWriter out = new PrintWriter(System.out); HelpFormatter help = new HelpFormatter(); help.setArgName("TESTS"); help.printHelp(out, LINE_BYTES, "java -jar test.jar", "Options controlling the test harness.", opts, 2, 4, "", true); Multimap<Class, Method> testMethods = getTestMethods(); help = new HelpFormatter(); help.setLongOptPrefix(""); help.setOptPrefix(""); help.setSyntaxPrefix(""); help.setLeftPadding(0); Options testOptions = new Options(); for (Class c : testMethods.keySet()) { testOptions.addOption( OptionBuilder.withDescription(getDescription(c)).withLongOpt(c.getSimpleName()).create()); for (Method m : testMethods.get(c)) { testOptions.addOption(OptionBuilder.withDescription(getDescription(m)) .withLongOpt(c.getSimpleName() + "." + m.getName()).create()); } } help.printHelp(out, LINE_BYTES, " ", "Tests:", testOptions, 0, 2, "", false); out.flush(); } catch (Exception e) { System.out.println(e); System.exit(1); } }