avoid showing json lists of remotes when not in json mode

This commit is contained in:
Joey Hess 2011-09-02 16:44:04 -04:00
parent cb5dacfd40
commit d1dd40c49b
3 changed files with 15 additions and 6 deletions

View file

@ -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