avoid showing json lists of remotes when not in json mode
This commit is contained in:
parent
cb5dacfd40
commit
d1dd40c49b
3 changed files with 15 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue