From e4a06a26b56dd76d783f2b4e45528ac8ee3028a5 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 12 Aug 2018 04:36:27 +0200 Subject: Add --help option to wrapper --- src/CabalHelper/Compiletime/Wrapper.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/CabalHelper/Compiletime/Wrapper.hs') diff --git a/src/CabalHelper/Compiletime/Wrapper.hs b/src/CabalHelper/Compiletime/Wrapper.hs index 3ea3462..ae936f3 100644 --- a/src/CabalHelper/Compiletime/Wrapper.hs +++ b/src/CabalHelper/Compiletime/Wrapper.hs @@ -65,7 +65,9 @@ usage = do globalArgSpec :: [OptDescr (Options -> Options)] globalArgSpec = - [ option "" ["verbose"] "Be more verbose" $ + [ option "h" ["help"] "Display help message" $ + NoArg $ \o -> o { oHelp = True } + , option "" ["verbose"] "Be more verbose" $ NoArg $ \o -> o { oVerbose = True } , option "" ["with-ghc"] "GHC executable to use" $ @@ -137,6 +139,7 @@ main = handlePanic $ do (opts', args) <- parseCommandArgs defaultOptions <$> getArgs opts <- overrideVerbosityEnvVar =<< guessProgramPaths opts' case args of + _ | oHelp opts -> usage [] -> usage "help":[] -> usage "version":[] -> putStrLn $ showVersion version -- cgit v1.2.3