Browse files

Replaced defn ^:private with defn- so it will build on Clojure 1.2

  • Loading branch information...
1 parent b0726dd commit ec7bdb3b1189db0dfcd7b1c0d92e784eef84f926 @seancorfield seancorfield committed Feb 14, 2012
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/main/clojure/clojure/tools/cli.clj
24 src/main/clojure/clojure/tools/cli.clj
@@ -4,12 +4,12 @@
[clojure.pprint :only (pprint cl-format)])
(:refer-clojure :exclude [replace]))
-(defn ^:private build-doc [{:keys [switches docs default]}]
+(defn- build-doc [{:keys [switches docs default]}]
[(apply str (interpose ", " switches))
(or (str default) "")
(or docs "")])
-(defn ^:private banner-for [specs]
+(defn- banner-for [specs]
(println "Usage:")
(let [docs (into (map build-doc specs)
@@ -24,34 +24,34 @@
(cl-format true "~{ ~vA ~vA ~vA ~}" v)
-(defn ^:private name-for [k]
+(defn- name-for [k]
(replace k #"^--no-|^--\[no-\]|^--|^-" ""))
-(defn ^:private flag-for [^String v]
+(defn- flag-for [^String v]
(not (.startsWith v "--no-")))
-(defn ^:private opt? [^String x]
+(defn- opt? [^String x]
(.startsWith x "-"))
-(defn ^:private flag? [^String x]
+(defn- flag? [^String x]
(.startsWith x "--[no-]"))
-(defn ^:private end-of-args? [x]
+(defn- end-of-args? [x]
(= "--" x))
-(defn ^:private spec-for
+(defn- spec-for
[arg specs]
(->> specs
(filter (fn [s]
(let [switches (set (s :switches))]
(contains? switches arg))))
-(defn ^:private default-values-for
+(defn- default-values-for
(into {} (for [s specs] [(s :name) (s :default)])))
-(defn ^:private apply-specs
+(defn- apply-specs
[specs args]
(loop [options (default-values-for specs)
extra-args []
@@ -80,7 +80,7 @@
(recur options (conj extra-args (first args)) (rest args)))))))
-(defn ^:private switches-for
+(defn- switches-for
[switches flag]
(-> (for [^String s switches]
@@ -89,7 +89,7 @@
:default [s]))
-(defn ^:private generate-spec
+(defn- generate-spec
(let [[switches raw-spec] (split-with #(and (string? %) (opt? %)) raw-spec)
[docs raw-spec] (split-with string? raw-spec)

0 comments on commit ec7bdb3

Please sign in to comment.