From 9617bc68ba9dde3224ab1063defff4c8aa558ac2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 8 Jul 2015 18:31:05 -0400 Subject: improve --help display for commands --- CmdLine.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs index 89f9964b7..c61a0050c 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -75,13 +75,10 @@ dispatch fuzzyok allargs allcmds commonoptions fields header getgitrepo = do parseCmd :: CmdParams -> [Command] -> (Command -> O.Parser v) -> O.ParserResult (Command, v) parseCmd allargs allcmds getparser = O.execParserPure (O.prefs O.idm) pinfo allargs where - pinfo = O.info (O.subparser $ mconcat $ map mkcommand allcmds) - ( O.fullDesc - <> O.progDesc "hiya" - <> O.header "ook - aaa" - ) + pinfo = O.info (O.helper <*> subcmds) O.fullDesc + subcmds = O.subparser $ mconcat $ map mkcommand allcmds mkcommand c = O.command (cmdname c) $ O.info (mkparser c) - (O.fullDesc <> O.progDesc (cmddesc c)) + (O.fullDesc <> O.header (cmddesc c)) mkparser c = (,) <$> pure c <*> getparser c -- cgit v1.2.3