diff options
| author | Daniel Gröber <dxld@darkboxed.org> | 2015-08-07 08:48:12 +0200 | 
|---|---|---|
| committer | Daniel Gröber <dxld@darkboxed.org> | 2015-08-07 08:48:12 +0200 | 
| commit | 494ae6f62a52932b4fef4803f669972a52568f61 (patch) | |
| tree | d60bd817d2ad6d8ffe22c12b50be3f89c33537ec | |
| parent | 5c88c17f8affb9d385955dce63e606f58261d194 (diff) | |
Add a human friendly output option to print-lbi
| -rw-r--r-- | CabalHelper/Main.hs | 8 | 
1 files changed, 5 insertions, 3 deletions
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  | 
