我試圖在Scala scopt 2.0.1庫中使用新的不可變的OptionParser。由於OptionParser需要一個泛型類型和幫助方法已經定義了返回Unit一個動作,我得到一個編譯時錯誤: case class Config(directory: String = null)
val parser = new OptionParser[Config]() {
def opti
我正在使用scopt來處理命令行參數,並且想要接受盲/無標籤的參數。讓我們以一個超級簡單,熟悉的「LS」命令爲例: ls [<selector>] [options]
where options is just one: --tree
所以使用的例子可能是: ls
ls --tree
ls . --tree
ls /foo/bar
ls /foo/bar --tree
的sco