                                        (dissoc (zipmap arguments arg-names) :context))
                                 cmdln)))))
 
+;;;
+
 (defmacro with-context-from-output
   "Runs body, expecting to get a string containing a formal
   context. Writes this string to a file and reads it in

  "Runs given commandline in an external shell process. Returns the
  output on stdout as result."
  [& cmdln]
  (let [result (apply sh
                      :return-map true
                      cmdln)]
    (when-not (zero? (:exit result))
      (illegal-state "External program " (first cmdln) " returned with non-zero status: " (:err result)))
    (:out result)))

(ns conexp.contrib.exec
  (:use conexp.main
        [conexp.io.util :only (tmpfile with-out-writer)])
  (:use [clojure.java.shell :only (sh)]))

(ns-doc "Executing external programs with a common interface.")

