     (str (program-fmt) (first errors))
     (str "The following errors occurred while parsing your action:\n\n"
          (s/join \newline errors))))
+
+(defn print-error-message
+  "Print errors messages generated by [[error-message]]."
+  [errors]
+  (binding [*out* *err*]
+    (println (error-msg errors))))
 
 (defn- parse-single [action-context actions action action-key
                      arguments single-action-mode?

    (apply action opts args)))

(defn handle-exception
  "Handle exceptions thrown from CLI actions."
  [e]
  (log/debugf "handle exception: <%s>" e)
  (let [msg (.getMessage e)]
    (if *log-error* (log/error e "action line parse error"))
    (if (instance? java.io.FileNotFoundException e)
      (binding [*out* *err*]
        (println (format "%sio error: %s" (program-fmt) msg)))
      (binding [*out* *err*]
        (println (format "%serror: %s"
                         (program-fmt)
                         (if ex-data

  @program-name-inst)

(defn- program-fmt []
  (let [name (if *include-program-in-errors*
               (str (program-name) ": ")
               "")]
    (if name
      (str name ": ")
      "")))
