diff options
-rw-r--r-- | tprint/src/Main.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tprint/src/Main.hs b/tprint/src/Main.hs index 8a534b8..5734e68 100644 --- a/tprint/src/Main.hs +++ b/tprint/src/Main.hs | |||
@@ -109,7 +109,15 @@ tprint TPrint{ operation = JobStatus{..}, ..} Client{..} out = jobStatus jobId > | |||
109 | tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format | 109 | tprint TPrint{ operation = Job{..}, ..} Client{..} out = job jobId >>= format |
110 | where format p | 110 | where format p |
111 | | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty p | 111 | | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty p |
112 | | otherwise <- output = T.hPutStrLn out =<< either throwM return (cobbcode p) | 112 | | otherwise = T.hPutStrLn out =<< either throwM return (cobbcode p) |
113 | |||
114 | tprint TPrint{ operation = Draft{..}, ..} Client{..} out = draft draftId >>= format | ||
115 | where format d@(fromMaybe "" . fmap T.unpack -> t, p) | ||
116 | | (JSON, _) <- output = LCBS.hPutStrLn out $ encodePretty d | ||
117 | | otherwise = do | ||
118 | hPutStrLn out t | ||
119 | hPutStrLn out "" | ||
120 | T.hPutStrLn out =<< either throwM return (cobbcode p) | ||
113 | 121 | ||
114 | -- Mutate | 122 | -- Mutate |
115 | tprint TPrint{ operation = JobCreate{..}, ..} client@Client{..} out = withPrintout input $ \p -> do | 123 | tprint TPrint{ operation = JobCreate{..}, ..} client@Client{..} out = withPrintout input $ \p -> do |