From bee3ec35ec95c272c201b8df931569b5f507e9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Thu, 5 Mar 2015 16:51:38 +0100 Subject: [PATCH] exe:ghc-mod: some output formatting changes --- src/GHCMod.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/GHCMod.hs b/src/GHCMod.hs index af8b356..5ce05d4 100644 --- a/src/GHCMod.hs +++ b/src/GHCMod.hs @@ -73,7 +73,7 @@ usage = -- TODO: Generate the stuff below automatically ghcModUsage :: String ghcModUsage = - "Usage: ghc-mod [OPTIONS...] COMMAND [OPTIONS...] \n\ + "Usage: ghc-mod [OPTIONS...] COMMAND [CMD_ARGS...] \n\ \*Global Options (OPTIONS)*\n\ \ Global options can be specified before and after the command and\n\ \ interspersed with command specific options\n\ @@ -383,7 +383,8 @@ progMain (globalOptions,cmdArgs) = do (res,_) <- runGhcModT globalOptions $ ghcCommands cmdArgs case res of Right s -> putStr s - Left e -> exitError $ render (gmeDoc e) + Left e -> exitError $ + renderStyle style { ribbonsPerLine = 1.2 } (gmeDoc e) -- Obtain ghc options by letting ourselfs be executed by -- @cabal repl@ @@ -524,7 +525,7 @@ newtype InvalidCommandLine = InvalidCommandLine (Either String String) instance Exception InvalidCommandLine exitError :: String -> IO a -exitError msg = hPutStrLn stderr msg >> exitFailure +exitError msg = hPutStrLn stderr (dropWhileEnd (=='\n') msg) >> exitFailure fatalError :: String -> a fatalError s = throw $ FatalError $ progName ++ ": " ++ s