(defn -main [& args]
(with-command-line args
"Get csv file name"
[[in-file-name ".csv input file name" "resultset.csv" ]]
(println "in-file-name:", in-file-name)))
The second vector of vector seems unnecessary.
Or tools.cli way:
(ns foo.main
(:gen-class)
(:use [clojure.tools.cli :only (cli optional)]))
(defn parse-opts
[args]
(cli args
(optional ["--in-file-name"
".csv input file"
:default "resultset.csv"]
identity)))
(defn -main
[& args]
(let [opts (parse-opts args)]
(println "in-file-name:" (:in-file-name opts))))
It might be verbose but I think it is more descriptive than
with-command-line one.
However, I'd like more documents and examples about tools.cli.
--
Name: OGINO Masanori (荻野 雅紀)
E-mail: [email protected]
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en