aboutsummaryrefslogtreecommitdiff
path: root/tprint
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-03-01 10:37:48 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2016-03-01 10:37:48 +0100
commit11ed93f1d94aa3bffa7a660128ac802743024a02 (patch)
tree8333046bb1156838b460395070205f942ef36712 /tprint
parent98c3756774df45817c479f1e09c5e9cb35503e84 (diff)
downloadthermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar
thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar.gz
thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar.bz2
thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.tar.xz
thermoprint-11ed93f1d94aa3bffa7a660128ac802743024a02.zip
jobStatus
Diffstat (limited to 'tprint')
-rw-r--r--tprint/src/Main.hs6
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
81tprint 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
81tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format 87tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format
82 where format p 88 where format p