From 68308c197b3e9bc25feaa92e65d4b9598ebb1fb9 Mon Sep 17 00:00:00 2001 From: "Daniel E. Renfer" Date: Thu, 23 Feb 2012 18:01:51 -0500 Subject: [PATCH] commands --- ciste-core/src/ciste/commands.clj | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ciste-core/src/ciste/commands.clj b/ciste-core/src/ciste/commands.clj index 165844d..1d6bd38 100644 --- a/ciste-core/src/ciste/commands.clj +++ b/ciste-core/src/ciste/commands.clj @@ -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 @@ -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})))))