List of usage examples for org.apache.commons.cli HelpFormatter printOptions
public void printOptions(PrintWriter pw, int width, Options options, int leftPad, int descPad)
Print the help for the specified Options to the specified writer, using the specified width, left padding and description padding.
From source file:de.unisb.cs.st.javaslicer.traceResult.TraceResult.java
private static void printHelp(Options options, PrintStream out) { out.println("Usage: " + TraceResult.class.getSimpleName() + " [<options>] <file>"); out.println("where <file> is the input trace file, and <options> may be one or more of"); HelpFormatter formatter = new HelpFormatter(); PrintWriter pw = new PrintWriter(out, true); formatter.printOptions(pw, 120, options, 5, 3); out.println();/*from w ww . j a v a 2s. com*/ out.println("The output of the trace itself will have six fields:"); out.println(" - Nr: just a continuously increasing counter, starting at 0"); out.println( " - intern Nr: this is the instance number, which will always be identical when iterating the trace"); out.println(" - Location: Class name, method name and line number of the instruction"); out.println(" - Dep: Stack depth of the instruction (1 for outermost stack frames, like main)"); out.println( " - OccNr: The occurence number of that single instruction (how often was it visited before)"); out.println(" - Instruction: Textual representation of the bytecode instruction"); out.println( "Remember that the trace is output backwards. This means nr, intern nr and occNr are counting from the end of the trace."); out.println("The intern Nr may have gaps if specific instructions have been filtered out (see -f option)."); out.println( "By default, labels that have been inserted during instrumentation (so called additionals) are filtered out."); }
From source file:de.unisb.cs.st.javaslicer.slicing.Slicer.java
private static void printHelp(Options options, PrintStream out) { out.println("Usage: " + Slicer.class.getSimpleName() + " [<options>] <file> <slicing criterion>"); out.println("where <file> is the input trace file"); out.println(" <slicing criterion> has the form <loc>[(<occ>)]:<var>[,<loc>[(<occ>)]:<var>]*"); out.println(" <options> may be one or more of"); HelpFormatter formatter = new HelpFormatter(); PrintWriter pw = new PrintWriter(out, true); formatter.printOptions(pw, 120, options, 5, 3); }
From source file:HLA.java
private static void help(Options options) { //String R = "\u001B[30m"; HelpFormatter formatter = new HelpFormatter(); formatter.setDescPadding(0);//from ww w . jav a 2 s . c o m String header = "\n" + "Program: Kourami - Graph-guided assembly of HLA typing exons\n" + "Version: " + HLA.VERSION + "\n" + "Contact: Heewook Lee <heewookl@cs.cmu.edu>\n\n" + "Usage: java -jar <PATH_TO>/Kourami.jar [options] <bam-1> ... <bam-n>\n\n" + " -h,--help print this message\n"; String footer = "\n"; System.err.println(header); PrintWriter tmp = new PrintWriter(System.err); formatter.printOptions(tmp, 80, options, 3, 3); tmp.println("\n"); tmp.println(" -hhy+. o o o o o o o o o o"); tmp.println(".` -syss:---.` o o o o o o o o o o o o o"); tmp.println(":+:` .:/o+++++///ommy+` o _ __ _"); tmp.println("`yhs/..:osssooooo++++dmNNNdo` o | |/ /___ _ _ _ __ __ _ _ __ ___ (_)"); tmp.println(" /syy///++++ooooooooodNMdNdmh: o | ' // _ \\| | | | '__/ _` | '_ ` _ \\| |"); tmp.println(" -do/` .://++++++++oodmmmmmmd- | . \\ (_) | |_| | | | (_| | | | | | | |"); tmp.println(" .+: `.://///+///ommmmdy- |_|\\_\\___/ \\__,_|_| \\__,_|_| |_| |_|_|"); tmp.println(" . -syo----..`` "); tmp.println(" +y+. \n\n"); tmp.flush(); tmp.close(); System.exit(1); }
From source file:com.milaboratory.mitcr.cli.Main.java
public static void printHelp() { HelpFormatter formatter = new HelpFormatter(); formatter.setOptionComparator(new Comparator<Option>() { @Override//from www . j a va 2s. c o m public int compare(Option o1, Option o2) { return Integer.compare(orderingMap.get(o1.getOpt()), orderingMap.get(o2.getOpt())); } }); final String executable = System.getProperty("executable", "java -jar mitcr.jar"); err.println("usage: " + executable + " -pset <preset name> [options] input_file output_file.cls"); err.println(" " + executable + " -pset <preset name> [options] input_file output_file.txt"); err.println(" " + executable + " -pset <preset name> [options] -export newPresetName"); err.println(); formatter.printOptions(new PrintWriter(err, true), 85, options, 2, 3); err.println(); }
From source file:com.ebay.jetstream.application.CliOptions.java
private void printUsageAndExit(boolean verbose) { PrintWriter pw = new PrintWriter(System.err, true); HelpFormatter hf = new HelpFormatter(); hf.printUsage(pw, 72, m_optionHandler.getClass().getCanonicalName(), m_options); if (verbose)//from w w w . j av a2 s . c o m hf.printOptions(pw, 72, m_options, 3, 3); System.exit(1); }
From source file:com.marklogic.shell.command.cp.java
public String getHelp() { StringBuffer buffer = new StringBuffer(); buffer.append("usage: cp [options] <from uri> <to uri>" + Environment.NEWLINE); buffer.append("Copies the document specified by the <from uri> to the <to uri>" + Environment.NEWLINE); buffer.append("Options: " + Environment.NEWLINE); HelpFormatter formatter = new HelpFormatter(); StringWriter help = new StringWriter(); formatter.printOptions(new PrintWriter(help), 80, options, 4, 8); buffer.append(help.toString());//from w w w.j a v a2 s . co m return buffer.toString(); }
From source file:com.marklogic.shell.command.ls.java
public String getHelp() { StringBuffer help = new StringBuffer(); help.append("usage: ls [xpath]" + Environment.NEWLINE); help.append(// w w w .jav a 2s. co m "List base-uri's for nodes returned in [xpath]. By default this command is" + Environment.NEWLINE); help.append("equivalent to running: for $i in input() order by base-uri($i) return base-uri($i) " + Environment.NEWLINE); help.append("Options: " + Environment.NEWLINE); HelpFormatter formatter = new HelpFormatter(); StringWriter buf = new StringWriter(); formatter.printOptions(new PrintWriter(buf), 80, options, 4, 8); help.append(buf.toString()); return help.toString(); }
From source file:com.marklogic.shell.command.rm.java
public String getHelp() { StringBuffer buffer = new StringBuffer(); buffer.append("usage: rm [options] [uri uri ...]" + Environment.NEWLINE); buffer.append("Remove documents from the database." + Environment.NEWLINE); buffer.append("Options: " + Environment.NEWLINE); HelpFormatter formatter = new HelpFormatter(); StringWriter help = new StringWriter(); formatter.printOptions(new PrintWriter(help), 80, options, 4, 8); buffer.append(help.toString());/* w w w.ja va 2 s .c om*/ return buffer.toString(); }
From source file:com.marklogic.shell.command.load.java
public String getHelp() { StringBuffer buffer = new StringBuffer(); buffer.append("usage: load [options] [file path]" + Environment.NEWLINE); buffer.append("Loads a document into Mark Logic from [file path]. The document uri defaults to" + Environment.NEWLINE); buffer.append("the file name." + Environment.NEWLINE); buffer.append("Options: " + Environment.NEWLINE); HelpFormatter formatter = new HelpFormatter(); StringWriter help = new StringWriter(); formatter.printOptions(new PrintWriter(help), 80, options, 4, 8); buffer.append(help.toString());/*ww w .jav a 2 s . c o m*/ return buffer.toString(); }
From source file:com.facebook.stetho.dumpapp.Dumper.java
private void dumpUsage(PrintStream output) { final String cmdName = "dumpapp"; HelpFormatter formatter = new HelpFormatter(); output.println("Usage: " + cmdName + " [options] <plugin> [plugin-options]"); PrintWriter writer = new PrintWriter(output); try {/*from w ww .j ava 2 s. c o m*/ formatter.printOptions(writer, formatter.getWidth(), mGlobalOptions.options, formatter.getLeftPadding(), formatter.getDescPadding()); } finally { writer.flush(); } }