Browse Source

Nicer function name

sstarkey 11 months ago
parent
commit
21e6826cfc
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      src/defenv/core.clj

+ 6
- 4
src/defenv/core.clj View File

@@ -108,19 +108,21 @@
108 108
     (if parse-difference? (format "\"%s\" -> %s" (first v) displayable)
109 109
                           displayable)))
110 110
 
111
-(defn spec->docs
111
+(defn display-spec->docs
112 112
   "Convert a display spec into a collection of objects suitable for
113 113
   displaying documentation"
114 114
   [display-spec]
115 115
   (map #(update % :value convert) (get-var-statuses display-spec)))
116 116
 
117
+(def ^:deprecated spec->docs display-spec->docs)
118
+
117 119
 (defn doc-table
118 120
   "Convert a connection of spec docs into a nice table"
119 121
   [env-docs]
120 122
   (with-out-str (print-table [:name :value :doc] env-docs)))
121 123
 
122 124
 (defn- make-usage-string [display-spec prefix]
123
-  (let [env-docs (spec->docs display-spec)]
125
+  (let [env-docs (display-spec->docs display-spec)]
124 126
     (if (empty? env-docs)
125 127
       "No environment variables defined!"
126 128
       (str prefix "\n" (doc-table env-docs)))))
@@ -209,7 +211,7 @@
209 211
 
210 212
 (defn- get-env-info [env-spec]
211 213
   (reduce-kv overlay-env
212
-             {:env-map (sorted-map) :display-spec (sorted-map)}
214
+             {:env-map (sorted-map), :display-spec (sorted-map)}
213 215
              (into (sorted-map) env-spec)))
214 216
 
215 217
 (defn env->map
@@ -361,7 +363,7 @@ missing."
361 363
    (println "\nExternal view:")
362 364
    (-> test-spec
363 365
        display-spec
364
-       spec->docs
366
+       display-spec->docs
365 367
        doc-table
366 368
        println))
367 369
  )