X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/xdg-ninja.git/blobdiff_plain/64aa55a202aff2021f49fc7701b9f76a9c26907f..7a09db63d7cd440cfc7a4216b83c3385c9db4e7d:/lib/Output.hs diff --git a/lib/Output.hs b/lib/Output.hs index c9f963d..ec66fce 100644 --- a/lib/Output.hs +++ b/lib/Output.hs @@ -1,12 +1,13 @@ module Output where -import qualified Data.Text as T -import Data.Text.ANSI +import Data.Char (isSpace) +import qualified Data.Text as T +import Data.Text.ANSI import Data.UUID import Data.UUID.V4 +import Program import System.Exit import System.Process -import Program getFilename :: IO String getFilename = do @@ -42,12 +43,14 @@ log mode name filename help = case mode of Output.log HELP name filename help SUCS -> putStrLn (line green name filename) HELP -> do - md <- renderMarkdown help + md <- case (all isSpace help) of + True -> renderMarkdown "_No help available._" + False -> renderMarkdown help putStr md logFile :: T.Text -> File -> Bool -> IO () logFile programName file onFilesystem = case onFilesystem of False -> Output.log SUCS (T.unpack programName) (path file) (help file) True -> case (supportLevel file) of - Unsupported -> Output.log WARN (T.unpack programName) (path file) (help file) - _ -> Output.log ERR (T.unpack programName) (path file) (help file) + Unsupported -> Output.log ERR (T.unpack programName) (path file) (help file) + _ -> Output.log WARN (T.unpack programName) (path file) (help file)