5
我使用Apache commons cli(1.2)进行命令行解析。Scala错误编译OptionBuilder
我在我的代码如下:
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中/何警告。) – 2011-02-04 22:21:06
@pst:我有他们。我在Netbeans(最好的Scala支持,恕我直言)工作,它强调`hasArg`方法。我更喜欢在IntelliJ中工作,但Scala插件在重新格式化代码中存在一些严重的错误。我提交了错误报告,但到目前为止,没有发布修复程序。 – Ralph 2011-02-05 13:53:05