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