List of usage examples for org.apache.commons.cli2.util HelpFormatter printHeader
public void printHeader()
From source file:broadwick.CliOptions.java
/** * Construct and provide GNU-compatible Options. Read the command line extracting the arguments, this * additionally displays the help message if the command line is empty. * * @param args the command line arguments. *//*from w w w . j a v a 2s .c om*/ public CliOptions(final String[] args) { buildCommandLineArguments(); final Parser parser = new Parser(); parser.setGroup(options); final HelpFormatter hf = new HelpFormatter(SPACE, SPACE, SPACE, LINEWIDTH); parser.setHelpFormatter(hf); parser.setHelpTrigger("--help"); cmdLine = parser.parseAndHelp(args); if (cmdLine == null) { hf.printHeader(); throw new BroadwickException("Empty command line."); } validateCommandLineArguments(); }