From 11ed93f1d94aa3bffa7a660128ac802743024a02 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 1 Mar 2016 10:37:48 +0100 Subject: jobStatus --- tprint/src/Main.hs | 6 ++++++ 1 file changed, 6 insertions(+) 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 | (Human, _) <- output = mapM_ (\(DraftId n, fromMaybe "" . fmap T.unpack -> t) -> hPutStrLn out $ show n ++ "\t" ++ t) $ Map.toAscList ds | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty ds | otherwise = hPutStrLn out . dumpStr $ Map.toAscList ds + +tprint TPrint{ operation = JobStatus{..}, ..} Client{..} out = jobStatus jobId >>= format + where format s + | (Human, _) <- output = hPutStrLn out $ humanJobStatus s Nothing + | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty s + | otherwise = hPutStrLn out $ dumpStr s tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format where format p -- cgit v1.2.3