List of usage examples for org.apache.commons.cli OptionBuilder withDescription
public static OptionBuilder withDescription(String newDescription)
From source file:org.apache.ambari.client.ClusterRename.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired();//from w w w. j ava2 s . c om OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster to be renamed"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("new_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("New name of the cluster"); Option new_name = OptionBuilder.create("new_name"); this.options = new Options(); options.addOption(new_name); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterStack.java
public void addOptions() { Option help = new Option("help", "Help"); Option expanded = new Option("expanded", "Return expanded version of stack inlining parent stack"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired();//from w w w . j av a 2s . c o m OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("file_path"); OptionBuilder.hasArg(); OptionBuilder.withDescription("File path to store the stack locally on client side"); Option file = OptionBuilder.create("file"); this.options = new Options(); options.addOption(name); options.addOption(file); options.addOption(expanded); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterUpdate.java
public void addOptions() { Option wait = new Option("wait", "Optionally wait for cluster to reach desired state"); Option dry_run = new Option("dry_run", "Dry run"); Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired();//from w w w . j ava2 s . co m OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster to be updated"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("stack_name"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster stack"); Option stack = OptionBuilder.create("stack"); OptionBuilder.withArgName("\"node_exp1; node_exp2; ...\""); OptionBuilder.hasArg(); OptionBuilder.withDescription( "List of node range expressions separated by semicolon (;) and contained in double quotes (\"\")"); Option nodes = OptionBuilder.create("nodes"); OptionBuilder.withArgName("stack_revision"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Stack revision"); Option revision = OptionBuilder.create("revision"); OptionBuilder.withArgName("description"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Description associated with cluster"); Option desc = OptionBuilder.create("desc"); OptionBuilder.withArgName("goalstate"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Desired goal state of the cluster"); Option goalstate = OptionBuilder.create("goalstate"); OptionBuilder.withArgName("\"component-1; component-2; ...\""); OptionBuilder.hasArg(); OptionBuilder.withDescription( "List of components to be active in the cluster. Components are seperated by semicolon \";\""); Option services = OptionBuilder.create("services"); OptionBuilder.withArgName("rolename=\"node_exp1; node_exp2; ... \""); OptionBuilder.hasArgs(2); OptionBuilder.withValueSeparator(); OptionBuilder.withDescription( "Node range expressions for a given rolename separated by semicolon (;) and contained in double quotes (\"\")"); Option role = OptionBuilder.create("role"); this.options = new Options(); options.addOption(wait); options.addOption(dry_run); options.addOption(name); options.addOption(stack); options.addOption(revision); options.addOption(desc); options.addOption(role); options.addOption(goalstate); options.addOption(nodes); options.addOption(services); options.addOption(help); }
From source file:org.apache.ambari.client.NodeGet.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("node_name"); OptionBuilder.isRequired();// ww w . j a v a 2s . c o m OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the node"); Option name = OptionBuilder.create("name"); this.options = new Options(); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.NodeList.java
public void addOptions() { Option help = new Option("help", "Help"); Option verbose = new Option("verbose", "Verbose mode"); OptionBuilder.withArgName("true/false"); OptionBuilder.hasArg();/*from ww w . j a va 2 s . c o m*/ OptionBuilder.withDescription( "State of the node indicating if node is allocated to some cluster. If not specified, implies both allocated and free nodes"); Option allocated = OptionBuilder.create("allocated"); OptionBuilder.withArgName("true/false"); OptionBuilder.hasArg(); OptionBuilder.withDescription( "State of the node to be listed. If not specified, implies both alive and dead nodes"); Option alive = OptionBuilder.create("alive"); this.options = new Options(); options.addOption(verbose); options.addOption(help); options.addOption(allocated); options.addOption(alive); }
From source file:org.apache.ambari.client.StackAdd.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("name"); OptionBuilder.isRequired();/*from ww w .j a v a2 s. c o m*/ OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the stack"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("location"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("Either URL or local file path where stack in JSON format is available"); Option location = OptionBuilder.create("location"); this.options = new Options(); options.addOption(location); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.StackGet.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("stack_name"); OptionBuilder.isRequired();/* w w w. j a va2 s . co m*/ OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the stack"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("revision"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster"); Option revision = OptionBuilder.create("revision"); OptionBuilder.withArgName("file_path"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Local file path"); Option file = OptionBuilder.create("file"); this.options = new Options(); options.addOption(name); options.addOption(revision); options.addOption(file); options.addOption(help); }
From source file:org.apache.ambari.client.StackHistory.java
public void addOptions() { Option help = new Option("help", "Help"); Option tree = new Option("tree", "tree representation"); OptionBuilder.withArgName("stack_name"); OptionBuilder.isRequired();//from w ww. j a v a2 s .c o m OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the stack"); Option name = OptionBuilder.create("name"); this.options = new Options(); options.addOption(name); options.addOption(tree); options.addOption(help); }
From source file:org.apache.ambari.client.StackList.java
public void addOptions() { Option help = new Option("help", "Help"); Option tree = new Option("tree", "tree representation"); OptionBuilder.withArgName("name"); OptionBuilder.hasArg();//from ww w .j a v a 2 s .c o m OptionBuilder.withDescription("Name of the stack"); Option name = OptionBuilder.create("name"); this.options = new Options(); options.addOption(name); options.addOption(tree); options.addOption(help); }
From source file:org.apache.axis2.schema.XSD2Java.java
/** * for now the arguments this main method accepts is the source schema and the output * location// ww w. ja va 2s . c o m * * @param args */ @SuppressWarnings("static-access") public static void main(String[] args) throws Exception { options = new Options(); options.addOption(OptionBuilder.withArgName(getMessage("schema.ns2p.argname")).hasArgs(2) .withValueSeparator().withDescription(getMessage("schema.ns2p.description")).create("ns2p")); options.addOption(OptionBuilder.withArgName(getMessage("schema.mp.argname")).hasArg() .withDescription(getMessage("schema.mp.description")).create("mp")); options.addOption(OptionBuilder.withArgName(getMessage("schema.dp.argname")).hasArg() .withDescription(getMessage("schema.dp.description")).create("dp")); options.addOption(OptionBuilder.withDescription(getMessage("schema.h.description")).create("h")); options.addOption(OptionBuilder.withArgName(getMessage("schema.p.argname")).hasArg() .withDescription(getMessage("schema.p.description")).create("p")); CommandLineParser parser = new GnuParser(); try { line = parser.parse(options, args); } catch (ParseException ex) { System.out.println(ex.getLocalizedMessage()); System.out.println(); printUsage(); System.out.println(ex); System.exit(1); } args = line.getArgs(); if (args.length < 2) { printUsage(); System.exit(1); } else { File outputFolder = new File(args[args.length - 1]); for (int i = 0; i < args.length - 1; i++) { File xsdFile = new File(args[i]); // Only output a message if the user has specified more than one schema file if (args.length > 2) { System.out.println(getMessage("schema.compiling", xsdFile.getName())); } compile(xsdFile, outputFolder); } } }