1
我從[org.clojure/tools.cli "0.1.0"]
移動到0.2.2,但我越來越爲什麼編譯tools.cli會導致向量參數錯誤?
Exception in thread "main" clojure.lang.ArityException:
Wrong number of args (2) passed to: PersistentVector
在符合(cli args
(defn parse-opts
"Using the newer cli library, parses command line args."
[args]
(cli args
["--ifn1" ".csv input file" :default "benetrak_roster.csv"]
["--ifn2" ".csv input file" :default "billing_roster.csv"]
["--rpt" ".csv pipe delimited output file" :default "bene_gic_rpt.csv"]
["--dump1" "text file report for debug output" :default "dumpfile1.txt"]
["--dump2" "text file report for debug output" :default "dumpfile2.txt"]
["--debug" "Debug flag for logging." :default 0 :parse-fn #(Integer. %)]))
tools.cli開始包括像這樣(:使用clojure.tools.cli )。
我看不到我做錯了什麼,並會感謝任何指針或幫助。謝謝。
順便說一句,我試着從看例子以下,和它不工作:
(defn -main
[& args]
(let [[opts args banner]
(cli args
["--ifn1" ".csv input file" :default "benetrak_roster.csv"]
["--ifn2" ".csv input file" :default "billing_roster.csv"]
["--rpt" ".csv pipe delimited output file" :default "bene_gic_rpt.csv"]
["--dump1" "text file report for debug output" :default "dumpfile1.txt"]
["--dump2" "text file report for debug output" :default "dumpfile2.txt"]
["--debug" "Debug flag for logging." :default 0 :parse-fn #(Integer. %)])
start-time (str (Date.))]
.
.
.
妙不可言。一個依賴模塊不必要地引入舊版本的tools.cli。謝謝。 – octopusgrabbus