类org.apache.commons.cli2.builder.ArgumentBuilder源码实例Demo

下面列出了怎么用org.apache.commons.cli2.builder.ArgumentBuilder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: jackrabbit-filevault   文件: CmdHelp.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("help")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argCommand = new ArgumentBuilder()
                            .withName("command")
                            .withDescription("prints the help for the given command")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码2 项目: jackrabbit-filevault   文件: CmdSet.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("set")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argKey= new ArgumentBuilder()
                            .withName("key")
                            .withDescription("name of the property")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .withOption(argValue= new ArgumentBuilder()
                            .withName("value")
                            .withDescription("value of the property. " +
                                    "If empty the property will be deleted")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码3 项目: jackrabbit-filevault   文件: CmdExec.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("exec")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argMacro = new ArgumentBuilder()
                            .withName("macro")
                            .withDescription(
                                    "specifies the command stored in the environment property" +
                                    " 'macro.<macro>'.")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码4 项目: jackrabbit-filevault   文件: CmdCtx.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("ctx")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argContext = new ArgumentBuilder()
                            .withName("context")
                            .withDescription("change to the given context. if empty display list.")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码5 项目: jackrabbit-filevault   文件: CmdStore.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("store")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argFile = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("specifies the config file. default is \"" + AbstractApplication.DEFAULT_CONF_FILENAME + "\"")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码6 项目: jackrabbit-filevault   文件: CmdConsole.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("console")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(new DefaultOptionBuilder()
                            .withShortName("F")
                            .withLongName("console-settings")
                            .withDescription("specifies the console settings file. default is \"" + AbstractApplication.DEFAULT_CONF_FILENAME + "\"")
                            .withArgument(argFile = new ArgumentBuilder()
                            .withName("file")
                            .withMinimum(1)
                            .withMaximum(1)
                            .withValidator(FileValidator.getExistingFileInstance())
                            .create())
                            .create()
                            )
                    .create())
            .create();
}
 
源代码7 项目: jackrabbit-filevault   文件: CmdLoad.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("load")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argFile = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("specifies the config file. default is \"" + AbstractApplication.DEFAULT_CONF_FILENAME + "\"")
                            .withMinimum(0)
                            .withMaximum(1)
                            .withValidator(FileValidator.getExistingFileInstance())
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码8 项目: jackrabbit-filevault   文件: CmdHello.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("hello")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argName = new ArgumentBuilder()
                            .withName("name")
                            .withDescription("print this name. default is 'world'")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码9 项目: jackrabbit-filevault   文件: CmdSave.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("save")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcr-path")
                            .withDescription("the jcr path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码10 项目: jackrabbit-filevault   文件: CmdRm.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("rm")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optRecursive = new DefaultOptionBuilder()
                            .withShortName("r")
                            .withDescription("remove the directory artifacts recursively")
                            .create())
                    .withOption(argPath = new ArgumentBuilder()
                            .withName("path")
                            .withDescription("the jcrfs path")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码11 项目: jackrabbit-filevault   文件: CmdVaultDebug.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("vltdebug")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_VERBOSE)
                    .withOption(OPT_QUIET)
                    .withOption(argCommand = new ArgumentBuilder()
                            .withName("cmd")
                            .withDescription("command")
                            .withMinimum(0)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码12 项目: jackrabbit-filevault   文件: CmdConnect.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("connect")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optForce = new DefaultOptionBuilder()
                            .withShortName("f")
                            .withDescription("force reconnect if already connected")
                            .create())
                    .withOption(argURI = new ArgumentBuilder()
                            .withName("rmiuri")
                            .withDescription("the rmi uri of the repository")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码13 项目: jackrabbit-filevault   文件: CmdPropList.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("proplist")
            .withName("pl")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_QUIET)
                    .withOption(optRecursive = new DefaultOptionBuilder()
                            .withShortName("R")
                            .withLongName("recursive")
                            .withDescription("descend recursively")
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to list the properties from")
                            .withMinimum(1)
                            .create())
                    .create()
            )
            .create();
}
 
源代码14 项目: jackrabbit-filevault   文件: CmdRefresh.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("refresh")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optKeepChanges = new DefaultOptionBuilder()
                            .withShortName("k")
                            .withDescription("keep changes")
                            .create())
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcr-path")
                            .withDescription("the jcr path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码15 项目: jackrabbit-filevault   文件: CmdTree.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("tree")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optRecursive = new DefaultOptionBuilder()
                            .withShortName("r")
                            .withDescription("limit depth")
                            .withArgument(new ArgumentBuilder()
                                    .withName("depth")
                                    .withDescription("limit tree to <depth>")
                                    .withMinimum(1)
                                    .withMaximum(1)
                                    .withValidator(NumberValidator.getIntegerInstance())
                                    .create())
                            .create())
                    .withOption(argPath = new ArgumentBuilder()
                                    .withName("path")
                                    .withDescription("the path of the tree")
                                    .withMinimum(0)
                                    .withMaximum(1)
                                    .create())
                    .create())
            .create();
}
 
源代码16 项目: jackrabbit-filevault   文件: CmdRevert.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("revert")
            .withName("rev")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_QUIET)
                    .withOption(optRecursive = new DefaultOptionBuilder()
                            .withShortName("R")
                            .withLongName("recursive")
                            .withDescription("descend recursively")
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to revert")
                            .withMinimum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码17 项目: jackrabbit-filevault   文件: CmdInfo.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("info")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_VERBOSE)
                    .withOption(OPT_QUIET)
                    .withOption(optRecursive = new DefaultOptionBuilder()
                            .withShortName("R")
                            .withLongName("recursive")
                            .withDescription("operate recursive")
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to display info")
                            .withMinimum(0)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码18 项目: jackrabbit-filevault   文件: CmdCat.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("cat")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcr-path")
                            .withDescription("the jcr path")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码19 项目: jackrabbit-filevault   文件: CmdInvalidate.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("invalidate")
            .withName("inv")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcr-path")
                            .withDescription("the jcr path")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码20 项目: jackrabbit-filevault   文件: CmdDelete.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("delete")
            .withName("del")
            .withName("rm")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_VERBOSE)
                    .withOption(OPT_QUIET)
                    .withOption(optForce = new DefaultOptionBuilder()
                            .withLongName("force")
                            .withDescription("force operation to run")
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to delete")
                            .withMinimum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码21 项目: jackrabbit-filevault   文件: CmdDiff.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("diff")
            .withName("di")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optNonRecursive = new DefaultOptionBuilder()
                            .withShortName("N")
                            .withLongName("non-recursive")
                            .withDescription("operate on single directory")
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to display the diffs from")
                            .withMinimum(0)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码22 项目: jackrabbit-filevault   文件: CmdDebug.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("debug")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argCommand = new ArgumentBuilder()
                            .withName("cmd")
                            .withDescription("the sub command")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create()
                    )
                    .withOption(argArgs = new ArgumentBuilder()
                            .withName("args")
                            .withDescription("command arguments")
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码23 项目: jackrabbit-filevault   文件: CmdDump.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("dump")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optConfig = new DefaultOptionBuilder()
                            .withShortName("c")
                            .withLongName("config")
                            .withDescription("writes the config to the local file")
                            .create())
                    .withOption(optFilter = new DefaultOptionBuilder()
                            .withShortName("f")
                            .withLongName("filter")
                            .withDescription("writes the workspace filter to the local file")
                            .create())
                    .withOption(argPath = new ArgumentBuilder()
                            .withName("path")
                            .withDescription("the path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create())
                    .create())
            .create();
}
 
源代码24 项目: jackrabbit-filevault   文件: CmdCd.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("cd")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(argPath = new ArgumentBuilder()
                                    .withName("path")
                                    .withDescription("destination path. changes to root directory if missing.")
                                    .withMinimum(0)
                                    .withMaximum(1)
                                    .create())
                    .create())
            .create();
}
 
源代码25 项目: jackrabbit-filevault   文件: CmdImport.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("import")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_VERBOSE)
                    /*
                    .withOption(optExclude = new DefaultOptionBuilder()
                            .withShortName("e")
                            .withDescription("specifies the excluded local files. can be multiple.")
                            .withArgument(new ArgumentBuilder()
                                    .withMinimum(0)
                                    .create())
                            .create())
                    */
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("local-path")
                            .withDescription("the local path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcr-path")
                            .withDescription("the jcr path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码26 项目: jackrabbit-filevault   文件: CmdStatus.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("status")
            .withName("st")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_VERBOSE)
                    .withOption(optOnlyControlled = new DefaultOptionBuilder()
                            .withShortName("q")
                            .withLongName("quiet")
                            .withDescription("show only status of controlled files")
                            .create())
                    .withOption(optShowUpdate = new DefaultOptionBuilder()
                            .withShortName("u")
                            .withLongName("show-update")
                            .withDescription("display update information")
                            .create())
                    .withOption(optNonRecursive = new DefaultOptionBuilder()
                            .withShortName("N")
                            .withLongName("non-recursive")
                            .withDescription("operate on single directory")
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to display the status")
                            .withMinimum(0)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码27 项目: jackrabbit-filevault   文件: CmdMount.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("mount")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(optForce = new DefaultOptionBuilder()
                            .withShortName("f")
                            .withLongName("force")
                            .withDescription("force remount if already mounted")
                            .create())
                    .withOption(optConfigFile = new DefaultOptionBuilder()
                            .withLongName("file")
                            .withDescription("config.xml for jcrfs")
                            .withArgument(new ArgumentBuilder()
                                    .withName("file")
                                    .withMinimum(0)
                                    .withMaximum(1)
                                    .create())
                            .create())
                    .withOption(optFilterFile = new DefaultOptionBuilder()
                            .withLongName("filter")
                            .withDescription("filter.xml for jcrfs")
                            .withArgument(new ArgumentBuilder()
                                    .withName("filter")
                                    .withMinimum(0)
                                    .withMaximum(1)
                                    .create())
                            .create())
                    .withOption(argPath = new ArgumentBuilder()
                            .withName("root")
                            .withDescription("the repository path that forms the mount root")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码28 项目: jackrabbit-filevault   文件: CmdExport.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("export")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_VERBOSE)
                    .withOption(optType = new DefaultOptionBuilder()
                            .withShortName("t")
                            .withDescription("specifies the export type. either 'platform' or 'jar'.")
                            .withArgument(new ArgumentBuilder()
                                    .withMinimum(0)
                                    .withMaximum(1)
                                    .create())
                            .create())
                    .withOption(optPrune = new DefaultOptionBuilder()
                            .withShortName("P")
                            .withLongName("prune-missing")
                            .withDescription("specifies if missing local files should be deleted.")
                            .create())
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcr-path")
                            .withDescription("the jcr path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("local-path")
                            .withDescription("the local path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码29 项目: jackrabbit-filevault   文件: CmdPut.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("put")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                            /*
                            .withOption(optForce = new DefaultOptionBuilder()
                                    .withShortName("f")
                                    .withDescription("force overwrite if local file already exists")
                                    .create())
                            */
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("local-path")
                            .withDescription("the local path")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create()
                    )
                    .withOption(argJcrPath = new ArgumentBuilder()
                            .withName("jcrl-path")
                            .withDescription("the jcr path")
                            .withMinimum(0)
                            .withMaximum(1)
                            .create()
                    )
                    .create()
            )
            .create();
}
 
源代码30 项目: jackrabbit-filevault   文件: CmdPropSet.java
protected Command createCommand() {
    return new CommandBuilder()
            .withName("propset")
            .withName("ps")
            .withDescription(getShortDescription())
            .withChildren(new GroupBuilder()
                    .withName("Options:")
                    .withOption(OPT_QUIET)
                    .withOption(optRecursive = new DefaultOptionBuilder()
                            .withShortName("R")
                            .withLongName("recursive")
                            .withDescription("descend recursively")
                            .create())
                    .withOption(argPropName = new ArgumentBuilder()
                            .withName("propname")
                            .withDescription("the property name")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create())
                    .withOption(argPropValue = new ArgumentBuilder()
                            .withName("propval")
                            .withDescription("the property value")
                            .withMinimum(1)
                            .withMaximum(1)
                            .create())
                    .withOption(argLocalPath = new ArgumentBuilder()
                            .withName("file")
                            .withDescription("file or directory to set the property to")
                            .withMinimum(1)
                            .create())
                    .create()
            )
            .create();
}