diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-03-01 10:37:48 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-03-01 10:37:48 +0100 |
commit | 11ed93f1d94aa3bffa7a660128ac802743024a02 (patch) | |
tree | 8333046bb1156838b460395070205f942ef36712 | |
parent | 98c3756774df45817c479f1e09c5e9cb35503e84 (diff) | |
download | thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar.gz thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar.bz2 thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar.xz thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.zip |
jobStatus
-rw-r--r-- | tprint/src/Main.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tprint/src/Main.hs b/tprint/src/Main.hs index 5b26bfe..6df335a 100644 --- a/tprint/src/Main.hs +++ b/tprint/src/Main.hs | |||
@@ -77,6 +77,12 @@ tprint TPrint{ operation = Drafts, ..} Client{..} out = drafts >>= format | |||
77 | | (Human, _) <- output = mapM_ (\(DraftId n, fromMaybe "" . fmap T.unpack -> t) -> hPutStrLn out $ show n ++ "\t" ++ t) $ Map.toAscList ds | 77 | | (Human, _) <- output = mapM_ (\(DraftId n, fromMaybe "" . fmap T.unpack -> t) -> hPutStrLn out $ show n ++ "\t" ++ t) $ Map.toAscList ds |
78 | | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty ds | 78 | | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty ds |
79 | | otherwise = hPutStrLn out . dumpStr $ Map.toAscList ds | 79 | | otherwise = hPutStrLn out . dumpStr $ Map.toAscList ds |
80 | |||
81 | tprint TPrint{ operation = JobStatus{..}, ..} Client{..} out = jobStatus jobId >>= format | ||
82 | where format s | ||
83 | | (Human, _) <- output = hPutStrLn out $ humanJobStatus s Nothing | ||
84 | | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty s | ||
85 | | otherwise = hPutStrLn out $ dumpStr s | ||
80 | 86 | ||
81 | tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format | 87 | tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format |
82 | where format p | 88 | where format p |