1.2.0 permalink Arrow_down_16x16
  • (print-help desc cmdmap)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/command_line.clj:68 top

(defn print-help [desc cmdmap]
  (println desc)
  (println "Options")
     (apply align [:l :l :l] 
        (for [spec (:cmdspec cmdmap) :when (vector? spec)]
            (let [[argnames [text default]] (split-with symbol? spec)
                  [_ opt q] (re-find #"^(.*[^?])(\??)$"
                                 (str (first argnames)))
                  argnames  (map (comp rmv-q str) argnames)
                        (join ", "
                          (for [arg argnames]
                            (if (= 1 (count arg))
                              (str "-" arg)
                              (str "--" arg))))]
               [(str "  " argnames (when (= "" q) " ") " ")
                (if-not default
                  (str " [default " default "]"))])))))
Vars in clojure.contrib.command-line/print-help: apply defn for let println
Used in 0 other vars

Comments top

No comments for print-help. Log in to add a comment.