Add a Diff output format

This commit is contained in:
Vidar Holen 2019-06-23 19:05:12 -07:00
parent b8b4a11348
commit b1aeee564c
8 changed files with 265 additions and 8 deletions

View file

@ -188,13 +188,7 @@ code num = "SC" ++ show num
getColorFunc :: ColorOption -> IO ColorFunc
getColorFunc colorOption = do
term <- hIsTerminalDevice stdout
let windows = "mingw" `isPrefixOf` os
let isUsableTty = term && not windows
let useColor = case colorOption of
ColorAlways -> True
ColorNever -> False
ColorAuto -> isUsableTty
useColor <- shouldOutputColor colorOption
return $ if useColor then colorComment else const id
where
colorComment level comment =