List of usage examples for org.apache.commons.cli Option setArgName
public void setArgName(String argName)
From source file:org.eclipse.jubula.app.dashboard.DashboardHttpServerApp.java
/** * /*w w w . j a va2 s . c o m*/ * @return the command line options for this application. */ private static Options createOptions() { Options options = new Options(); Option configPathOption = new Option(OPTION_CONFIG_PATH, true, "the path to the configuration file"); //$NON-NLS-1$ configPathOption.setArgName("path"); //$NON-NLS-1$ options.addOption(configPathOption); options.addOption(OPTION_HELP, false, "print this message"); //$NON-NLS-1$ return options; }
From source file:org.eclipse.jubula.client.cmd.AbstractCmdlineClient.java
/** * @param name name of optione//from ww w . ja va2 s . c o m * @param hasArg option has an argument * @param argname name of the argument * @param text Text for help * @param isReq option sis required * @return Option opt */ protected static Option createOption(String name, boolean hasArg, String argname, String text, boolean isReq) { Option opt = new Option(name, hasArg, text); opt.setRequired(isReq); opt.setArgName(argname); return opt; }
From source file:org.esa.cci.sst.tool.Tool.java
private static Option createOption(String shortOpt, String longOpt, String argName, String description) { Option from = new Option(shortOpt, longOpt, argName != null, description); from.setRequired(false);/*from ww w.ja v a2s .c o m*/ from.setArgName(argName); return from; }
From source file:org.esa.cci.sst.tools.BasicTool.java
private static Options createCommandLineOptions() { final Option helpOpt = new Option("help", "print this message"); final Option versionOpt = new Option("version", "print the version information and exit"); final Option verboseOpt = new Option("verbose", "be extra verbose"); final Option debugOpt = new Option("debug", "print debugging information"); final Option confFileOpt = new Option(CONFIG_FILE_OPTION_NAME, "alternative configuration file"); confFileOpt.setArgs(1);//from w ww.j a v a 2 s .c om confFileOpt.setArgName("file"); confFileOpt.setType(File.class); final Option propertyOpt = new Option("D", "use value for given property"); propertyOpt.setValueSeparator('='); propertyOpt.setArgName("property=value"); propertyOpt.setArgs(2); Options options = new Options(); options.addOption(helpOpt); options.addOption(versionOpt); options.addOption(verboseOpt); options.addOption(debugOpt); options.addOption(confFileOpt); options.addOption(propertyOpt); return options; }
From source file:org.fcrepo.exporter.ArgParser.java
/** * Constructor that creates the command line options *//*w ww . j a v a 2 s .co m*/ public ArgParser() { // Command Line Options cmdOptions = new Options(); // Help option final Option helpOption = new Option("h", "help", false, "Print this message"); helpOption.setRequired(false); cmdOptions.addOption(helpOption); // Mode option final Option importExportOption = new Option("m", "mode", true, "Mode: [import|export]"); importExportOption.setRequired(true); importExportOption.setArgs(1); importExportOption.setArgName("mode"); cmdOptions.addOption(importExportOption); // Resource option final Option resourceOption = new Option("r", "resource", true, "Resource (URI) to import/export"); resourceOption.setRequired(true); resourceOption.setArgs(1); resourceOption.setArgName("resource"); cmdOptions.addOption(resourceOption); // Binary Directory option final Option binDirOption = new Option("b", "binDir", true, "Directory to store binaries (files)"); binDirOption.setRequired(false); binDirOption.setArgs(1); binDirOption.setArgName("binDir"); cmdOptions.addOption(binDirOption); // Description Directory option final Option descDirOption = new Option("d", "descDir", true, "Directory to store RDF descriptions"); descDirOption.setRequired(true); descDirOption.setArgs(1); descDirOption.setArgName("descDir"); cmdOptions.addOption(descDirOption); // RDF extension option final Option rdfExtOption = new Option("x", "rdfExt", true, "RDF filename extension (default: " + DEFAULT_RDF_EXT); rdfExtOption.setRequired(false); rdfExtOption.setArgs(1); rdfExtOption.setArgName("rdfExt"); cmdOptions.addOption(rdfExtOption); // RDF language option final Option rdfLangOption = new Option("l", "rdfLang", true, "RDF language (default: " + DEFAULT_RDF_LANG); rdfLangOption.setRequired(false); rdfLangOption.setArgs(1); rdfLangOption.setArgName("rdfLang"); cmdOptions.addOption(rdfLangOption); }
From source file:org.fcrepo.importer.ArgParser.java
/** * Constructor that creates the command line options *//*from ww w. j a v a2s. c om*/ public ArgParser() { // Command Line Options cmdOptions = new Options(); // Help option final Option helpOption = new Option("h", "help", false, "Print this message"); helpOption.setRequired(false); cmdOptions.addOption(helpOption); // Mode option final Option importExportOption = new Option("m", "mode", true, "Mode: [import|export]"); importExportOption.setRequired(true); importExportOption.setArgs(1); importExportOption.setArgName("mode"); cmdOptions.addOption(importExportOption); }
From source file:org.fusesource.mop.support.OptionBuilder.java
public Option op() { Option option = new Option(id != null ? id : " ", name, arg != null || args > 0, description); option.setRequired(required);/*from w w w.j a v a2 s.c o m*/ option.setType(type); option.setValueSeparator(sperator); if (arg != null && args == -1) { args = 1; } option.setArgs(args); option.setArgName(arg); return option; }
From source file:org.glite.slcs.SLCSInfo.java
/** * Creates the CLI options./*from w ww.jav a 2s .c o m*/ * * @return The CLI Options */ private static Options createCommandLineOptions() { Option help = new Option("h", "help", false, "this help"); Option config = new Option("c", "conf", true, "SLCS client XML configuration file"); config.setArgName("filename"); Option verbose = new Option("v", "verbose", false, "verbose"); Option version = new Option("V", "version", false, "shows the version"); // Option list= new Option("l", "list", false, "list the IdP providerIds"); Options options = new Options(); options.addOption(help); // options.addOption(list); options.addOption(config); options.addOption(verbose); options.addOption(version); return options; }
From source file:org.glite.slcs.SLCSInit.java
/** * Creates the CLI options./*from ww w . ja va 2 s . c o m*/ * * @return The CLI Options */ private static Options createCommandLineOptions() { Option help = new Option("h", "help", false, "this help"); Option username = new Option("u", "user", true, "Shibboleth username"); username.setArgName("username"); Option idp = new Option("i", "idp", true, "Shibboleth IdP providerId"); idp.setArgName("providerId"); Option config = new Option("c", "conf", true, "SLCS client XML configuration file"); config.setArgName("filename"); Option verbose = new Option("v", "verbose", false, "verbose"); Option version = new Option("V", "version", false, "shows the version"); Option password = new Option("p", "password", true, "Shibboleth password"); password.setArgName("password"); Option keysize = new Option("s", "keysize", true, "private key size (default: 1024)"); keysize.setArgName("size"); Option keypassword = new Option("k", "keypass", true, "private key password (default: same as Shibboleth password)"); keypassword.setArgName("password"); Option prefix = new Option("P", "prefix", true, "optional usercert.pem and userkey.pem filename prefix"); prefix.setArgName("prefix"); Option storedir = new Option("D", "storedir", true, "absolute pathname to the store directory (default: $HOME/.globus)"); storedir.setArgName("directory"); Option p12 = new Option("x", "p12", false, "store additional PKCS12 usercred.p12 file"); Options options = new Options(); options.addOption(help); options.addOption(username); options.addOption(password); options.addOption(idp); options.addOption(config); options.addOption(verbose); options.addOption(version); options.addOption(keysize); options.addOption(keypassword); options.addOption(prefix); options.addOption(storedir); options.addOption(p12); return options; }
From source file:org.italiangrid.voms.clients.options.VOMSCLIOptionBuilder.java
public static Option buildOption(String longOpt, CLIOptionsBundle b) { String shortOpt = b.getStringFromBundle(longOpt, BundleKey.opt); String description = b.getStringFromBundle(longOpt, BundleKey.description); boolean hasArg = false; if (b.getStringFromBundle(longOpt, BundleKey.hasArg) != null) hasArg = Boolean.parseBoolean(b.getStringFromBundle(longOpt, BundleKey.hasArg)); String argDescription = b.getStringFromBundle(longOpt, BundleKey.argDescription); Option o = new Option(shortOpt, longOpt, hasArg, description); o.setArgName(argDescription); return o;// w w w . ja v a 2 s . c o m }