summaryrefslogtreecommitdiff
path: root/Messages
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-02 16:44:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-02 16:44:04 -0400
commitd1dd40c49bb95416adec5b33e4dc1e7672a2f7f7 (patch)
treed8d1eee5f21463bd87b0b502fa54e468f34e4f9f /Messages
parentcb5dacfd403a5ca4e3bdeb3eb3d0009136966f91 (diff)
avoid showing json lists of remotes when not in json mode
Diffstat (limited to 'Messages')
-rw-r--r--Messages/JSON.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Messages/JSON.hs b/Messages/JSON.hs
index ee6ea34a3..fb95f550e 100644
--- a/Messages/JSON.hs
+++ b/Messages/JSON.hs
@@ -8,9 +8,12 @@
module Messages.JSON (
start,
end,
- note
+ note,
+ add
) where
+import Text.JSON
+
import qualified Utility.JSONStream as Stream
start :: String -> String -> IO ()
@@ -20,4 +23,7 @@ end :: Bool -> IO ()
end b = putStr $ Stream.add [("success", b)] ++ Stream.end
note :: String -> IO ()
-note s = putStr $ Stream.add [("note", s)]
+note s = add [("note", s)]
+
+add :: JSON a => [(String, a)] -> IO ()
+add v = putStr $ Stream.add v