summaryrefslogtreecommitdiff
path: root/Messages/JSON.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Messages/JSON.hs')
-rw-r--r--Messages/JSON.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Messages/JSON.hs b/Messages/JSON.hs
index fb95f550e..a325ef130 100644
--- a/Messages/JSON.hs
+++ b/Messages/JSON.hs
@@ -16,8 +16,12 @@ import Text.JSON
import qualified Utility.JSONStream as Stream
-start :: String -> String -> IO ()
-start command file = putStr $ Stream.start [("command", command), ("file", file)]
+start :: String -> Maybe String -> IO ()
+start command file =
+ putStr $ Stream.start $ ("command", command) : filepart file
+ where
+ filepart Nothing = []
+ filepart (Just f) = [("file", f)]
end :: Bool -> IO ()
end b = putStr $ Stream.add [("success", b)] ++ Stream.end