From 691f97181129642b5a1bd4d2e347afb182db90a5 Mon Sep 17 00:00:00 2001 From: nzeh Date: Wed, 18 Mar 2009 23:51:52 +0100 Subject: Allow color markup in monitor output templates With this patch, colors can be included in the output template of a monitor. E.g., ["-t", "TX colorSpec + +-- | Recognizes color specification and returns it unchanged +colorSpec :: Parser String +colorSpec = (try $ string "") <|> try ( + do string " char ',' <|> char '#') + char '>' + return $ "") -- | Parses the command part of the template string -templateCommandParser :: Parser (String,String,String) +templateCommandParser :: Parser String templateCommandParser = do { char '<' ; com <- many $ noneOf ">" ; char '>' - ; return $ ("",com,"") + ; return com } -- | Combines the template parsers -- cgit v1.2.3