Skip to content

Commit

Permalink
commands
Browse files Browse the repository at this point in the history
  • Loading branch information
duck1123 committed Feb 23, 2012
1 parent c09e279 commit 68308c1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions ciste-core/src/ciste/commands.clj
Expand Up @@ -4,7 +4,8 @@
[routes :only [resolve-routes]]
[views :only [defview]]))
(:require (ciste [predicates :as pred])
(clojure [string :as string])))
(clojure [string :as string])
(clojure.tools [logging :as log])))

(defonce
^{:dynamic true
Expand All @@ -27,16 +28,18 @@

(defn parse-command
"Takes a sequence of key/value pairs and runs a command"
[& opts]
(let [command (apply hash-map opts)
[{:as command}]
(log/info "parsing command")
(let [
;; command (apply hash-map opts)
{:keys [name args]} (spy command)]
((->> @*commands*
spy
(map (fn [[k v]] [{:name k} {:action v}]))
(resolve-routes @*command-predicates*))
(merge command
{:format :text
:serialization :command}))))
(spy ((->> @*commands*
spy
(map (fn [[k v]] [{:name k} {:action v}]))
(resolve-routes @*command-predicates*))
(merge command
{:format :text
:serialization :command})))))



Expand Down

0 comments on commit 68308c1

Please sign in to comment.