Search in sources :

Example 1 with HelpFormatter

use of org.apache.commons.cli.HelpFormatter in project flink by apache.

the class FlinkYarnSessionCli method printUsage.

private void printUsage() {
    System.out.println("Usage:");
    HelpFormatter formatter = new HelpFormatter();
    formatter.setWidth(200);
    formatter.setLeftPadding(5);
    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);
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter) Options(org.apache.commons.cli.Options) HighAvailabilityOptions(org.apache.flink.configuration.HighAvailabilityOptions)

Example 2 with HelpFormatter

use of org.apache.commons.cli.HelpFormatter in project groovy by apache.

the class FileSystemCompiler method displayHelp.

public static void displayHelp(final Options options) {
    final HelpFormatter formatter = new HelpFormatter();
    formatter.printHelp(80, "groovyc [options] <source-files>", "options:", options, "");
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter)

Example 3 with HelpFormatter

use of org.apache.commons.cli.HelpFormatter in project hadoop by apache.

the class ExecuteCommand method printHelp.

/**
   * Gets extended help for this command.
   */
@Override
public void printHelp() {
    String header = "Execute command runs a submits a plan for execution on " + "the given data node.\n\n";
    String footer = "\nExecute command submits the job to data node and " + "returns immediately. The state of job can be monitored via query " + "command. ";
    HelpFormatter helpFormatter = new HelpFormatter();
    helpFormatter.printHelp("hdfs diskbalancer -execute <planfile>", header, DiskBalancerCLI.getExecuteOptions(), footer);
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter)

Example 4 with HelpFormatter

use of org.apache.commons.cli.HelpFormatter in project hadoop by apache.

the class HelpCommand method printHelp.

/**
   * Gets extended help for this command.
   */
@Override
public void printHelp() {
    String header = "\nDiskBalancer distributes data evenly between " + "different disks on a datanode. " + "DiskBalancer operates by generating a plan, that tells datanode " + "how to move data between disks. Users can execute a plan by " + "submitting it to the datanode. \nTo get specific help on a " + "particular command please run \n\n hdfs diskbalancer -help <command>.";
    HelpFormatter helpFormatter = new HelpFormatter();
    helpFormatter.printHelp("hdfs diskbalancer [command] [options]", header, DiskBalancerCLI.getHelpOptions(), "");
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter)

Example 5 with HelpFormatter

use of org.apache.commons.cli.HelpFormatter in project hadoop by apache.

the class PlanCommand method printHelp.

/**
   * Gets extended help for this command.
   */
@Override
public void printHelp() {
    String header = "Creates a plan that describes how much data should be " + "moved between disks.\n\n";
    String footer = "\nPlan command creates a set of steps that represent a " + "planned data move. A plan file can be executed on a data node, which" + " will balance the data.";
    HelpFormatter helpFormatter = new HelpFormatter();
    helpFormatter.printHelp("hdfs diskbalancer -plan <hostname> [options]", header, DiskBalancerCLI.getPlanOptions(), footer);
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter)

Aggregations

HelpFormatter (org.apache.commons.cli.HelpFormatter)273 Options (org.apache.commons.cli.Options)136 CommandLine (org.apache.commons.cli.CommandLine)126 CommandLineParser (org.apache.commons.cli.CommandLineParser)110 ParseException (org.apache.commons.cli.ParseException)103 GnuParser (org.apache.commons.cli.GnuParser)92 Path (org.apache.hadoop.fs.Path)42 PrintWriter (java.io.PrintWriter)35 Option (org.apache.commons.cli.Option)29 Job (org.apache.hadoop.mapreduce.Job)27 Configuration (org.apache.hadoop.conf.Configuration)21 File (java.io.File)17 IOException (java.io.IOException)14 DefaultParser (org.apache.commons.cli.DefaultParser)13 PosixParser (org.apache.commons.cli.PosixParser)12 FileSystem (org.apache.hadoop.fs.FileSystem)12 BasicParser (org.apache.commons.cli.BasicParser)11 ArrayList (java.util.ArrayList)8 URI (java.net.URI)6 FSDataOutputStream (org.apache.hadoop.fs.FSDataOutputStream)6