作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
IntelliJ 显示 OptionBuilder 在来自 http://commons.apache.org/proper/commons-cli/usage.html 的示例代码中已弃用.
我应该用什么来代替?
import org.apache.commons.cli.*;
Options options = new Options();
options.addOption(OptionBuilder.withLongOpt( "block-size" )
.withDescription( "use SIZE-byte blocks" )
.hasArg()
.withArgName("SIZE")
.create());
最佳答案
来自 http://commons.apache.org/proper/commons-cli/javadocs/api-release/index.html
Deprecated. since 1.3, use Option.builder(String) instead
这是替换:
Options options = new Options();
Option option = Option.builder("a")
.longOpt( "block-size" )
.desc( "use SIZE-byte blocks" )
.hasArg()
.argName( "SIZE" )
.build();
options.addOption( option );
关于java - Apache 公共(public) CLI : replacement for deprecated OptionBuilder?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35050704/
我正在使用 Apache commons cli (1.2) 进行命令行解析。 我的代码中有以下内容: import org.apache.commons.cli.OptionBuilder Opti
我想做类似的事情 public static final Option job1 = OptionBuilder.hasArg(false) .isRequired(false
IntelliJ 显示 OptionBuilder 在来自 http://commons.apache.org/proper/commons-cli/usage.html 的示例代码中已弃用. 我应该
我是一名优秀的程序员,十分优秀!