Example usage for org.apache.commons.cli HelpFormatter setWidth

List of usage examples for org.apache.commons.cli HelpFormatter setWidth

Introduction

In this page you can find the example usage for org.apache.commons.cli HelpFormatter setWidth.

Prototype

public void setWidth(int width) 

Source Link

Document

Sets the 'width'.

Usage

From source file:org.apache.flink.yarn.cli.FlinkYarnCLI.java

private void printUsage() {
    System.out.println("Usage:");
    HelpFormatter formatter = new HelpFormatter();
    formatter.setWidth(200);
    formatter.setLeftPadding(5);/*from   www. j a  va  2  s .co m*/

    formatter.setSyntaxPrefix("   Optional");
    Options options = new Options();
    addGeneralOptions(options);
    addRunOptions(options);
    formatter.printHelp(" ", options);
}

From source file:org.apache.flink.yarn.cli.FlinkYarnSessionCli.java

private void printUsage() {
    System.out.println("Usage:");
    HelpFormatter formatter = new HelpFormatter();
    formatter.setWidth(200);
    formatter.setLeftPadding(5);/* w  w w .ja va 2  s  . com*/
    formatter.setSyntaxPrefix("   Required");
    Options req = new Options();
    req.addOption(CONTAINER);
    formatter.printHelp(" ", req);

    formatter.setSyntaxPrefix("   Optional");
    Options options = new Options();
    addGeneralOptions(options);
    addRunOptions(options);
    formatter.printHelp(" ", options);
}

From source file:org.apache.flink.yarn.Client.java

private void printUsage() {
    System.out.println("Usage:");
    HelpFormatter formatter = new HelpFormatter();
    formatter.setWidth(200);
    formatter.setLeftPadding(5);//from  w  w  w.  j  a  v  a  2s  . c  o  m
    formatter.setSyntaxPrefix("   Required");
    Options req = new Options();
    req.addOption(CONTAINER);
    formatter.printHelp(" ", req);

    formatter.setSyntaxPrefix("   Optional");
    Options opt = new Options();
    opt.addOption(VERBOSE);
    opt.addOption(JM_MEMORY);
    opt.addOption(TM_MEMORY);
    opt.addOption(TM_CORES);
    opt.addOption(QUERY);
    opt.addOption(QUEUE);
    opt.addOption(SLOTS);
    opt.addOption(DYNAMIC_PROPERTIES);
    formatter.printHelp(" ", opt);
}

From source file:org.apache.hadoop.hbase.loadtest.LoadTester.java

private static void printUsage() {
    HelpFormatter helpFormatter = new HelpFormatter();
    helpFormatter.setWidth(80);
    helpFormatter.printHelp(USAGE, HEADER, options, FOOTER);
}

From source file:org.apache.hadoop.hbase.util.AbstractHBaseTool.java

protected void printUsage() {
    HelpFormatter helpFormatter = new HelpFormatter();
    helpFormatter.setWidth(80);
    String usageHeader = "Options:";
    String usageFooter = "";
    String usageStr = "bin/hbase " + getClass().getName() + " <options>";

    helpFormatter.printHelp(usageStr, usageHeader, options, usageFooter);
}

From source file:org.apache.hadoop.hive.llap.cli.LlapOptionsProcessor.java

private void printUsage() {
    HelpFormatter hf = new HelpFormatter();
    try {/*from  www  . ja  va2s . c om*/
        int width = hf.getWidth();
        int jlineWidth = TerminalFactory.get().getWidth();
        width = Math.min(160, Math.max(jlineWidth, width)); // Ignore potentially incorrect values
        hf.setWidth(width);
    } catch (Throwable t) { // Ignore
    }
    hf.printHelp("llap", options);
}

From source file:org.apache.hadoop.hive.llap.cli.LlapStatusOptionsProcessor.java

public static void printUsage() {
    HelpFormatter hf = new HelpFormatter();
    try {/*w w w  .j ava  2s. c  om*/
        int width = hf.getWidth();
        int jlineWidth = TerminalFactory.get().getWidth();
        width = Math.min(160, Math.max(jlineWidth, width)); // Ignore potentially incorrect values
        hf.setWidth(width);
    } catch (Throwable t) { // Ignore
    }

    LlapStatusOptionsProcessor optionsProcessor = new LlapStatusOptionsProcessor();
    hf.printHelp(LLAPSTATUS_CONSTANT, optionsProcessor.options);
}

From source file:org.apache.hadoop.hive.llap.cli.service.LlapServiceCommandLine.java

private static void printUsage() {
    HelpFormatter hf = new HelpFormatter();
    try {//from   ww  w.  j a  v  a  2s.  com
        int width = hf.getWidth();
        int jlineWidth = TerminalFactory.get().getWidth();
        width = Math.min(160, Math.max(jlineWidth, width));
        hf.setWidth(width);
    } catch (Throwable t) { // Ignore
    }

    hf.printHelp("llap", OPTIONS);
}

From source file:org.apache.hadoop.hive.llap.cli.status.LlapStatusServiceCommandLine.java

private static void printUsage() {
    HelpFormatter hf = new HelpFormatter();
    try {//from w  w  w.  j a  v a 2s .c  o  m
        int width = hf.getWidth();
        int jlineWidth = TerminalFactory.get().getWidth();
        width = Math.min(160, Math.max(jlineWidth, width));
        hf.setWidth(width);
    } catch (Throwable t) { // Ignore
    }

    hf.printHelp("llapstatus", OPTIONS);
}

From source file:org.apache.hadoop.hive.metastore.tools.metatool.HiveMetaToolCommandLine.java

private static void printUsage() {
    HelpFormatter hf = new HelpFormatter();
    try {//from  w ww.  ja  v a  2s. com
        int width = hf.getWidth();
        int jlineWidth = TerminalFactory.get().getWidth();
        width = Math.min(160, Math.max(jlineWidth, width));
        hf.setWidth(width);
    } catch (Throwable t) { // Ignore
    }

    hf.printHelp("metatool", OPTIONS);
}