Skip to content

Commit

Permalink
Add a verbose :very option. Inc version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Mar 23, 2012
1 parent 313012e commit 8073576
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,3 +1,3 @@
(defproject conch "0.2.3"
(defproject conch "0.2.4"
:description "A better shell-out library for Clojure."
:dependencies [[org.clojure/clojure "1.3.0"]])
6 changes: 4 additions & 2 deletions src/conch/core.clj
Expand Up @@ -8,8 +8,8 @@
output stream, and err stream as a map of :in, :out, and :err keys
If passed the optional :dir and/or :env keyword options, the dir
and enviroment will be set to what you specify. If you pass
:verbose and it is true, commands will be printed before being
executed."
:verbose and it is true, commands will be printed. If it is :very,
both commands and env vars will be printed."
[& args]
(let [[cmd args] (split-with (complement keyword?) args)
args (apply hash-map args)
Expand All @@ -20,6 +20,8 @@
(when-let [dir (:dir args)]
(.directory builder (io/file dir)))
(when (:verbose args) (apply println cmd))
(when-let [env (and (= :very (:verbose args)) (:env args))]
(prn env))
(let [process (.start builder)]
{:out (.getInputStream process)
:in (.getOutputStream process)
Expand Down

0 comments on commit 8073576

Please sign in to comment.