 
 (defn- error-msg
   [errors]
-  (str "The following errors occurred while parsing your command:\n\n"
-       (util/join-lines errors)))
+  (util/join-lines (cons "The following errors occurred while parsing your command:\n" errors)))
 
 (defn- validate-template
   [template]

            [clojure.tools.cli :refer [parse-opts]]
            [mount.core :as mount]
            [clojure.java.io :as io]
            [slingshot.slingshot :refer [try+]]))

; ----- Private functions -----


  ; TODO: clojure.spec validation
  )

(defmulti has-input?
  "Test if `input` provides something."
  type)

(defmethod has-input? File
  [input]
  (with-open [reader (io/reader input)]
    (.ready reader)))

(defmethod has-input? Reader
  [input]
  (let [c (.read input)]
    (.unread input c)
    (boolean c)))

(defn- main
  [{:keys [endpoint input]
    :as params}
   template]
  (validate-params params)
  (validate-template template)
  (let [piped? (has-input? input)
