List of usage examples for org.apache.commons.cli OptionBuilder withDescription
public static OptionBuilder withDescription(String newDescription)
From source file:org.apache.usergrid.tools.Import.java
@Override @SuppressWarnings("static-access") public Options createOptions() { Option hostOption = OptionBuilder.withArgName("host").hasArg().withDescription("Cassandra host") .create("host"); Option inputDir = OptionBuilder.hasArg().withDescription("input directory -inputDir").create(INPUT_DIR); Option verbose = OptionBuilder .withDescription("Print on the console an echo of the content written to the file").create(VERBOSE); Options options = new Options(); options.addOption(hostOption);//from www . ja va2 s . c o m options.addOption(inputDir); options.addOption(verbose); return options; }
From source file:org.apache.usergrid.tools.ImportAdmins.java
@Override @SuppressWarnings("static-access") public Options createOptions() { // inherit parent options Options options = super.createOptions(); Option inputDir = OptionBuilder.hasArg().withDescription("input directory -inputDir").create(INPUT_DIR); Option writeThreads = OptionBuilder.hasArg().withDescription("Write Threads -writeThreads") .create(WRITE_THREAD_COUNT); Option auditThreads = OptionBuilder.hasArg().withDescription("Audit Threads -auditThreads") .create(AUDIT_THREAD_COUNT); Option verbose = OptionBuilder .withDescription("Print on the console an echo of the content written to the file").create(VERBOSE); options.addOption(writeThreads);// ww w . ja v a 2 s. c om options.addOption(auditThreads); options.addOption(inputDir); options.addOption(verbose); return options; }
From source file:org.apache.usergrid.tools.ToolBase.java
@SuppressWarnings("static-access") public Options createOptions() { Option hostOption = OptionBuilder.withArgName("host").hasArg().withDescription("Cassandra host") .create("host"); Option remoteOption = OptionBuilder.withDescription("Use remote Cassandra instance").create("remote"); Option verbose = OptionBuilder .withDescription("Print on the console an echo of the content written to the file").create(VERBOSE); Options options = new Options(); options.addOption(hostOption);/*from w ww . j av a 2 s. co m*/ options.addOption(remoteOption); options.addOption(verbose); return options; }
From source file:org.apache.usergrid.tools.WarehouseExport.java
@Override @SuppressWarnings("static-access") public Options createOptions() { Options options = super.createOptions(); Option startTime = OptionBuilder.hasArg().withDescription("minimum modified time -startTime") .create(START_TIME);/*from ww w.j a va 2s .c om*/ Option endTime = OptionBuilder.hasArg().withDescription("maximum modified time -endTime").create(END_TIME); Option upload = OptionBuilder.withDescription("upload files to blob-store").create(UPLOAD); options.addOption(startTime); options.addOption(endTime); options.addOption(upload); return options; }
From source file:org.b3log.latke.client.LatkeClient.java
/** * Gets options./*from w w w . ja v a 2 s .co m*/ * * @return options */ private static Options getOptions() { final Options ret = new Options(); ret.addOption(OptionBuilder.withArgName("server").hasArg() .withDescription("For server address. For example, localhost:8080").isRequired().create('s')); ret.addOption(OptionBuilder.withDescription("Create tables.").create("create_tables")); ret.addOption(OptionBuilder.withArgName("username").hasArg().withDescription("Username").isRequired() .create('u')); ret.addOption(OptionBuilder.withArgName("password").hasArg().withDescription("Password").isRequired() .create('p')); ret.addOption(OptionBuilder.withArgName("backup_dir").hasArg().withDescription("Backup directory") .isRequired().create("backup_dir")); ret.addOption(OptionBuilder.withDescription("Backup data").create("backup")); ret.addOption(OptionBuilder.withDescription("Restore data").create("restore")); ret.addOption(OptionBuilder.withArgName("writable").hasArg() .withDescription("Disable/Enable repository writes. For example, -w true").create('w')); ret.addOption(OptionBuilder.withDescription( "Prints repository names and creates directories with the repository names under" + " back_dir") .create("repository_names")); ret.addOption(OptionBuilder.withDescription("Extras verbose").create("verbose")); ret.addOption(OptionBuilder.withDescription("Prints help").create('h')); ret.addOption(OptionBuilder.withDescription("Prints this client version").create('v')); return ret; }
From source file:org.clinigrid.capillary.inspector.Inspector.java
private static CommandLine parse(String[] args) { Options opts = new Options(); OptionBuilder.withArgName("external-model-uris"); OptionBuilder.hasArg();//from w w w . java 2 s . co m OptionBuilder.withDescription("set the paths of the external model URIs to import (semi-colon separated)"); opts.addOption(OptionBuilder.create("i")); OptionBuilder.withArgName("jar-file-path"); OptionBuilder.hasArg(); OptionBuilder .withDescription("set the path of the archive file (jar or war) to scan (semi-colon separated)"); opts.addOption(OptionBuilder.create("j")); OptionBuilder.withArgName("dependency-jar"); OptionBuilder.hasArg(); OptionBuilder.withDescription("set the paths of the dependency archives (semi-colon separated)"); opts.addOption(OptionBuilder.create("d")); OptionBuilder.withArgName("output-file.ecore"); OptionBuilder.hasArg(); OptionBuilder.withDescription("set the output ecore file name"); opts.addOption(OptionBuilder.create("o")); opts.addOption("v", "verbose", false, "set the verbose mode"); opts.addOption("h", "help", false, "print this message"); opts.addOption("V", "version", false, "print the version information and exit"); CommandLine cl = null; try { cl = new GnuParser().parse(opts, args); } catch (ParseException e) { exit("dcmmwl: " + e.getMessage()); throw new RuntimeException("unreachable"); } if (cl.hasOption('V')) { Package p = Inspector.class.getPackage(); System.out.println("Capillary v" + p.getImplementationVersion()); System.exit(0); } if (cl.hasOption('h') /*|| cl.getArgList().size() != 1*/) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(USAGE, DESCRIPTION, opts, EXAMPLE); System.exit(0); } return cl; }
From source file:org.controlhaus.webservice.generator.ExtensionMaker.java
private static Options buildOptions() { Options options = new Options(); OptionBuilder.hasArg();/*from w ww .j av a 2 s .com*/ OptionBuilder.withArgName("dir"); OptionBuilder.withDescription("Base directory of the wsdl file(s)"); OptionBuilder.isRequired(true); Option option = OptionBuilder.create("wsdl"); options.addOption(option); OptionBuilder.hasArg(); OptionBuilder.withArgName("dir"); OptionBuilder.withDescription("Root directory for the jcx file."); OptionBuilder.isRequired(true); option = OptionBuilder.create("gen_root"); options.addOption(option); // OptionBuilder.hasArg(); // OptionBuilder.withArgName("URL"); // OptionBuilder.withDescription("URL to the web service."); // option = OptionBuilder.create("serviceURL"); // OptionBuilder.isRequired(false); // if specified, it will overwrite // // the one in WSDL // options.addOption(option); OptionBuilder.hasArg(); OptionBuilder.withArgName("dir"); OptionBuilder.isRequired(false); OptionBuilder.withDescription("path annotation to use in the jcx"); option = OptionBuilder.create("wsdl_path_annotation"); options.addOption(option); OptionBuilder.hasArg(); OptionBuilder.withArgName("package_name"); OptionBuilder.isRequired(false); OptionBuilder.withDescription("Package name of the jcx"); option = OptionBuilder.create("pkg"); options.addOption(option); return options; }
From source file:org.dcm4che.tool.ihe.modality.Modality.java
@SuppressWarnings("static-access") private static void addOptions(Options opts) { opts.addOption(OptionBuilder.hasArg().withArgName("code-value").withDescription(rb.getString("kos-title")) .withLongOpt("kos-title").create()); opts.addOption(/*from w ww.ja va2 s . c o m*/ OptionBuilder.hasArg().withArgName("file").withDescription(rb.getString("o-file")).create("o")); opts.addOption(OptionBuilder.hasArg().withArgName("file").withDescription(rb.getString("code-config")) .withLongOpt("code-config").create()); OptionGroup mpps = new OptionGroup(); mpps.addOption(OptionBuilder.withDescription(rb.getString("mpps-late")).withLongOpt("mpps-late").create()); mpps.addOption(OptionBuilder.withDescription(rb.getString("mpps")).withLongOpt("mpps").create()); opts.addOptionGroup(mpps); opts.addOption(OptionBuilder.withDescription(rb.getString("stgcmt")).withLongOpt("stgcmt").create()); opts.addOption(null, "dc", false, rb.getString("dc")); opts.addOption(OptionBuilder.hasArg().withArgName("code-value").withDescription(rb.getString("dc-reason")) .withLongOpt("dc-reason").create()); opts.addOption(OptionBuilder.hasArgs().withArgName("[seq/]attr=value").withValueSeparator('=') .withDescription(rb.getString("set")).create("s")); }
From source file:org.dcm4che2.tool.chess3d.Chess3D.java
private static CommandLine parse(String[] args) { Options opts = new Options(); Option oThickness = new Option("t", "thickness", true, "Slice Thickness, 1 by default"); oThickness.setArgName("thickness"); opts.addOption(oThickness);//from w ww. j ava 2s. c o m Option oLocation = new Option("l", "location", true, "Slice Location of first image, 0.0\\0.0\\0.0 by default"); oLocation.setArgName("location"); opts.addOption(oLocation); Option ox = new Option("x", "rectWidth", true, "Width of one chess rectangle (x-coord). 100 by default"); ox.setArgName("x"); opts.addOption(ox); Option oy = new Option("y", "rectDepth", true, "Heigth of one chess rectangle (y-coord). 100 by default"); oy.setArgName("y"); opts.addOption(oy); Option oX = new Option("X", "xRect", true, "Number of chess fields in x-coord, 10 by default"); oX.setArgName("X"); opts.addOption(oX); Option oY = new Option("Y", "yRect", true, "Number of chess fields in y-coord, 10 by default"); oY.setArgName("Y"); opts.addOption(oY); Option oZ = new Option("Z", "zRect", true, "Number of chess fields in z-coord, 5 by default"); oZ.setArgName("Z"); opts.addOption(oZ); Option oW = new Option("w", "white", true, "White field value (0-255), 225 by default"); oW.setArgName("w"); opts.addOption(oW); Option oB = new Option("b", "black", true, "Black field value (0-255), 0 by default"); oB.setArgName("b"); opts.addOption(oB); Option oWin = new Option("win", "window", true, "Window level. Format: <center>\\<width>. 128\\256 by default"); oWin.setArgName("win"); opts.addOption(oWin); OptionBuilder.withArgName("dir"); OptionBuilder.hasArg(); OptionBuilder.withDescription( "Destination directory, parent of xml file or current working directory by default"); opts.addOption(OptionBuilder.create("d")); opts.addOption("S", "studyUID", false, "Create new Study Instance UID. Only effective if xmlFile is specified and studyIUID is set"); opts.addOption("s", "seriesUID", false, "create new Series Instance UID. Only effective if xmlFile is specified and seriesIUID is set"); OptionBuilder.withArgName("prefix"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Generate UIDs with given prefix, 1.2.40.0.13.1.<host-ip> by default."); opts.addOption(OptionBuilder.create("uid")); opts.addOption("h", "help", false, "print this message"); opts.addOption("V", "version", false, "print the version information and exit"); CommandLine cl = null; try { cl = new GnuParser().parse(opts, args); } catch (ParseException e) { exit("chess3d: " + e.getMessage()); throw new RuntimeException("unreachable"); } if (cl.hasOption('V')) { Package p = Chess3D.class.getPackage(); System.out.println("chess3d v" + p.getImplementationVersion()); System.exit(0); } if (cl.hasOption('h') || cl.getArgList().size() < 1) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(USAGE, DESCRIPTION, opts, EXAMPLE); System.exit(0); } return cl; }
From source file:org.dcm4che2.tool.dcm2dcm.Dcm2Dcm.java
private static CommandLine parse(String[] args) { Options opts = new Options(); opts.addOption(null, "no-fmi", false, "Encode result without File Meta Information. At default, " + " File Meta Information is included."); opts.addOption("e", "explicit", false, "Encode result with Explicit VR Little Endian Transfer Syntax. " + "At default, Implicit VR Little Endian is used."); opts.addOption("b", "big-endian", false, "Encode result with Explicit VR Big Endian Transfer Syntax. " + "At default, Implicit VR Little Endian is used."); opts.addOption("z", "deflated", false, "Encode result with Deflated Explicit VR Little Endian Syntax. " + "At default, Implicit VR Little Endian is used."); OptionBuilder.withArgName("[seq/]attr=value"); OptionBuilder.hasArgs(2);/*www . j a va2s .c o m*/ OptionBuilder.withValueSeparator('='); OptionBuilder.withDescription( "specify value to set in the output stream. Currently only works when transcoding images."); opts.addOption(OptionBuilder.create("s")); opts.addOption("t", "syntax", true, "Encode result with the specified transfer syntax - recodes" + " the image typically."); OptionBuilder.withArgName("KB"); OptionBuilder.hasArg(); OptionBuilder.withDescription("transcoder buffer size in KB, 1KB by default"); OptionBuilder.withLongOpt("buffer"); opts.addOption(OptionBuilder.create(null)); opts.addOption("h", "help", false, "print this message"); opts.addOption("V", "version", false, "print the version information and exit"); CommandLine cl = null; try { cl = new PosixParser().parse(opts, args); } catch (ParseException e) { exit("dcm2dcm: " + e.getMessage()); throw new RuntimeException("unreachable"); } if (cl.hasOption('V')) { Package p = Dcm2Dcm.class.getPackage(); System.out.println("dcm2dcm v" + p.getImplementationVersion()); System.exit(0); } if (cl.hasOption('h') || cl.getArgList().size() < 2) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(USAGE, DESCRIPTION, opts, EXAMPLE); System.exit(0); } return cl; }