Package org.apache.commons.cli

Examples of org.apache.commons.cli.HelpFormatter.printOptions()


  private void printOptions(boolean error) {
    PrintWriter pw = error ? new PrintWriter(System.err) : new PrintWriter(System.out);
    pw.println("Options:\n");
    HelpFormatter formatter = new HelpFormatter();
    formatter.printOptions(pw, 100, options, 0, 10);
    pw.flush();
    pw.close();
    if (error) {
      throw new UsageException();
    }
View Full Code Here


                    "Bug Reports to <users@openejb.apache.org>";


            if (!printHeader){
                pw.append(header).append("\n\n");
                formatter.printOptions(pw, 74, options, 1, 3);
            } else {
                formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
            }

            pw.flush();
View Full Code Here

                "Bug Reports to <users@openejb.apache.org>";


            if (!printHeader) {
                pw.append(header).append("\n\n");
                formatter.printOptions(pw, 74, options, 1, 3);
            } else {
                formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
            }

            pw.flush();
View Full Code Here

                "Bug Reports to <users@openejb.apache.org>";


            if (!printHeader) {
                pw.append(header).append("\n\n");
                formatter.printOptions(pw, 74, options, 1, 3);
            } else {
                formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
            }

            pw.flush();
View Full Code Here

        HelpFormatter formatter = new HelpFormatter();
        for (Map.Entry<String, Options> entry : commands.entrySet()) {
            String s = LEFT_PADDING + cliName + " " + entry.getKey() + " ";
            if (entry.getValue().getOptions().size() > 0) {
                pw.println(s + "<OPTIONS> " + commandsHelp.get(entry.getKey()));
                formatter.printOptions(pw, 100, entry.getValue(), s.length(), 3);
            }
            else {
                pw.println(s + commandsHelp.get(entry.getKey()));
            }
            pw.println();
View Full Code Here

                    "Bug Reports to <users@openejb.apache.org>";


            if (!printHeader){
                pw.append(header).append("\n\n");
                formatter.printOptions(pw, 74, options, 1, 3);
            } else {
                formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
            }

            pw.flush();
View Full Code Here

    pw.println("Usage:" +
        "\n\t " + TOOL_NAME + " view [ <option> ... ]" +
        "\n\t " + TOOL_NAME + " invalidate --host <name> --transaction <id>");
    pw.println("\nOptions:\n");
    HelpFormatter formatter = new HelpFormatter();
    formatter.printOptions(pw, 100, options, 0, 10);
    pw.flush();
    pw.close();
  }

  /**
 
View Full Code Here

        for (String comm : commandsToPrint) {
            Options opts = commands.get(comm);
            String s = LEFT_PADDING + cliName + " " + comm + " ";
            if (opts.getOptions().size() > 0) {
                pw.println(s + "<OPTIONS> " + commandsHelp.get(comm));
                formatter.printOptions(pw, 100, opts, s.length(), 3);
            }
            else {
                pw.println(s + commandsHelp.get(comm));
            }
            pw.println();
View Full Code Here

                    "Bug Reports to <users@openejb.apache.org>";


            if (!printHeader){
                pw.append(header).append("\n\n");
                formatter.printOptions(pw, 74, options, 1, 3);
            } else {
                formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
            }

            pw.flush();
View Full Code Here

                "Bug Reports to <users@tomee.apache.org>";


            if (!printHeader) {
                pw.append(header).append("\n\n");
                formatter.printOptions(pw, 74, options, 1, 3);
            } else {
                formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
            }

            pw.flush();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.