X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-cabal%2FMain.hs;h=d64c2240a8b3274765275bf7eab654ab0f4e707e;hb=d05212cf8475778cf41758c04f4eee510ae47e98;hp=0581f147cae5b0ad19a6678211c4c5466a802887;hpb=d41c40efd3137286617798e6be2cfdb6a80ae2a6;p=ghc-hetmet.git diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 0581f14..d64c224 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -28,7 +28,8 @@ import System.Exit import System.FilePath main :: IO () -main = do args <- getArgs +main = do hSetBuffering stdout LineBuffering + args <- getArgs case args of "hscolour" : distDir : dir : args' -> runHsColour distDir dir args' @@ -393,13 +394,13 @@ generate config_args distdir directory escape = foldr (\c xs -> if c == '#' then '\\':'#':xs else c:xs) [] wrap = mapM wrap1 wrap1 s - | null s = die "Wrapping empty value" - | '\'' `elem` s = die "Single quote in value to be wrapped" + | null s = die ["Wrapping empty value"] + | '\'' `elem` s = die ["Single quote in value to be wrapped:", s] -- We want to be able to assume things like is the -- start of a value, so check there are no spaces in confusing -- positions - | head s == ' ' = die "Leading space in value to be wrapped" - | last s == ' ' = die "Trailing space in value to be wrapped" + | head s == ' ' = die ["Leading space in value to be wrapped:", s] + | last s == ' ' = die ["Trailing space in value to be wrapped:", s] | otherwise = return ("\'" ++ s ++ "\'") boolToYesNo True = "YES" boolToYesNo False = "NO"