Example usage for org.apache.commons.cli2.util HelpFormatter printFooter

List of usage examples for org.apache.commons.cli2.util HelpFormatter printFooter

Introduction

In this page you can find the example usage for org.apache.commons.cli2.util HelpFormatter printFooter.

Prototype

public void printFooter() 

Source Link

Document

Prints a footer string if necessary

Usage

From source file:org.opencloudengine.flamingo.mapreduce.util.CommandLineUtil.java

public static void printHelpWithGenericOptions(Group group) throws IOException {
    Options ops = new Options();
    new GenericOptionsParser(new Configuration(), ops, new String[0]);
    org.apache.commons.cli.HelpFormatter fmt = new org.apache.commons.cli.HelpFormatter();
    fmt.printHelp("<command> [Generic Options] [Job-Specific Options]", "Generic Options:", ops, "");

    PrintWriter pw = new PrintWriter(System.out, true);
    HelpFormatter formatter = new HelpFormatter();
    formatter.setGroup(group);/* w w  w. j ava2s. c  om*/
    formatter.setPrintWriter(pw);
    formatter.printHelp();
    formatter.setFooter(
            "Hadoop Job? ?  HDFS    ? ?  .");
    formatter.printFooter();

    pw.flush();
}