   (when v
     (print (str "  * " label ": "))
     (print (apply str (repeat (- WIDTH (count label)) \space)))
-    (print (green "\"" (first v) "\""))
+    (print (color/green "\"" (:version-string v) "\""))
     (println)))
 
 (defn- print-version-seq

(ns ^{ :doc "List artifact version information."
       :author "Yannick Scherer" }
  leiningen.ancient.get
  (:require [leiningen.ancient.utils.projects :refer [collect-repositories]]
            [leiningen.ancient.utils.cli :refer [parse-cli]]
            [leiningen.ancient.utils.io :refer [with-output-settings]]
            [ancient-clj.verbose :refer :all]
            [ancient-clj.core :as anc]
            [version-clj.core :as v]
            [ancient-clj.repository :refer [retrieve-latest-version-string!]]))

(def ^:private ^:const WIDTH
  "Maximum width of labels for `:get`."

          (doseq [v vp] (print (pr-str v) ""))))
      (println "]"))))

(defn- print-all-versions
  [vs]
  (let [releases (filter (complement (comp v/qualified? :version)) vs)
        snapshots (filter (comp v/snapshot? :version) vs)
        qualified (filter (comp  #(and (not (v/snapshot? %)) (v/qualified? %)) :version) vs)]
    (println)
    (println (str "  * " (count vs) " version(s) found."))
    (print-version "latest release" (first releases))
    (print-version "latest SNAPSHOT" (first snapshots))
    (print-version "latest qualified" (first qualified))
    (print-version-seq "all releases" releases)
    (print-version-seq "all SNAPSHOTs" snapshots)
    (print-version-seq "all qualified versions" qualified)
    (println)))

(utils/deftask get
  {:docstring "List all versions for a given artifact."
   :exclude [:all :allow-all :allow-snapshots :allow-qualified
             :check-clojure :interactive :plugins :no-profiles
             :no-tests :tests :print :recursive]
   :fixed {:snapshots? true
           :qualified? true
           :dependencies? true
           :plugins? true}}
  [{:keys [artifact-opts args]}]
  (if-let [artifact' (first args)]
    (let [{:keys [symbol] :as artifact} (ancient/read-artifact artifact')]
      (verbosef "retrieving versions for %s from %d repositories ..."
                (color/yellow symbol)
                (count (:repositories artifact-opts)))
      (let [vs (ancient/versions! artifact artifact-opts)]
        (if (seq vs)
          (print-all-versions vs)
          (verbosef "no versions found."))))
    (errorf "no artifact coordinates given.")))

(utils/deftask latest
  {:docstring "List all versions for a given artifact."
   :exclude [:all :check-clojure :interactive :plugins
             :no-profiles :no-tests :tests :print :recursive]
   :fixed {:dependencies? true
           :plugins? true}}
  [{:keys [artifact-opts args]}]
  (if-let [artifact' (first args)]
    (let [{:keys [symbol] :as artifact} (ancient/read-artifact artifact')
          vs (ancient/latest-version-string! artifact artifact-opts)]
      (if vs
         (println (format "[%s %s]" symbol (pr-str vs)))
         (println "no versions found.")))
    (errorf "no artifact coordinates given.")))
