use of joptsimple.BuiltinHelpFormatter in project universa by UniversaBlockchain.
the class CLIMain method usage.
private static void usage(String text) {
boolean error = false;
PrintStream out = System.out;
if (text != null) {
out = System.err;
error = true;
}
out.println("\nUniversa client tool, v. " + CLI_VERSION + "\n");
if (options == null)
System.err.println("error while parsing command line");
else {
Integer columns = (Integer) options.valueOf("term-width");
if (columns == null)
columns = 120;
if (text != null)
out.println("ERROR: " + text + "\n");
try {
parser.formatHelpWith(new BuiltinHelpFormatter(columns, 2));
parser.printHelpOn(out);
out.println("\nOnline docs: https://lnd.im/UniClientUserManual\n");
} catch (IOException e) {
e.printStackTrace();
}
}
System.exit(100);
}
use of joptsimple.BuiltinHelpFormatter in project spring-boot by spring-projects.
the class OptionHandler method getHelp.
public String getHelp() {
if (this.help == null) {
getParser().formatHelpWith(new BuiltinHelpFormatter(80, 2));
OutputStream out = new ByteArrayOutputStream();
try {
getParser().printHelpOn(out);
} catch (IOException ex) {
return "Help not available";
}
this.help = out.toString().replace(" --cp ", " -cp ");
}
return this.help;
}
use of joptsimple.BuiltinHelpFormatter in project hazelcast-simulator by hazelcast.
the class CliUtils method printHelpAndExit.
static void printHelpAndExit(OptionParser parser, OutputStream sink) {
try {
parser.formatHelpWith(new BuiltinHelpFormatter(HELP_WIDTH, HELP_INDENTATION));
parser.printHelpOn(sink);
} catch (Exception e) {
throw new CommandLineExitException("Could not print command line help", e);
}
exit(0);
}
Aggregations