From 494ae6f62a52932b4fef4803f669972a52568f61 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 7 Aug 2015 08:48:12 +0200 Subject: Add a human friendly output option to print-lbi --- CabalHelper/Main.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'CabalHelper') diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs index e704e21..4c64f42 100644 --- a/CabalHelper/Main.hs +++ b/CabalHelper/Main.hs @@ -88,7 +88,7 @@ usage = do where usageMsg = "" ++"DIST_DIR ( version\n" - ++" | print-lbi\n" + ++" | print-lbi [--human]\n" ++" | write-autogen-files\n" ++" | compiler-version\n" ++" | ghc-options [--with-inplace]\n" @@ -244,8 +244,10 @@ main = do res <- componentsMap lbi v distdir $$ \_ _ bi -> return $ hsSourceDirs bi return $ Just $ ChResponseCompList (res ++ [(ChSetupHsName, [])]) - "print-lbi":[] -> - return $ Just $ ChResponseLbi $ show lbi + "print-lbi":flags -> + case flags of + ["--human"] -> print lbi >> return Nothing + [] -> return $ Just $ ChResponseLbi $ show lbi cmd:_ | not (cmd `elem` commands) -> errMsg ("Unknown command: " ++ cmd) >> usage >> exitFailure -- cgit v1.2.3