【发布时间】:2011-02-04 21:48:24
【问题描述】:
我正在使用 Apache commons cli (1.2) 进行命令行解析。
我的代码中有以下内容:
import org.apache.commons.cli.OptionBuilder
OptionBuilder.withLongOpt("db-host").hasArg.
withDescription("Name of the database host").create('h')
我收到错误 hasArg is not a member of org.apache.commons.cli.OptionBuilder。如果我将.hasArg 更改为.hasArg() 没有区别。
为什么?
顺便说一句,Java 解析得很好。
【问题讨论】:
-
(提醒:在javac/Eclipse/wherever中开启警告。)
-
@pst:我有他们。我在 Netbeans 工作(最好的 Scala 支持,恕我直言),它强调了
hasArg方法。我更喜欢在 IntelliJ 中工作,但是 Scala 插件在重新格式化代码时存在一些严重的错误。我已提交错误报告,但到目前为止,尚未发布任何修复。
标签: parsing scala apache-commons-cli