few more subcommand --help improvements

This commit is contained in:
Joey Hess 2015-07-09 01:53:15 -04:00
parent d8d1499229
commit bd9ed413ce

View file

@ -82,9 +82,9 @@ parseCmd :: CmdParams -> [Command] -> (Command -> O.Parser v) -> O.ParserResult
parseCmd allargs allcmds getparser = O.execParserPure (O.prefs O.idm) pinfo allargs parseCmd allargs allcmds getparser = O.execParserPure (O.prefs O.idm) pinfo allargs
where where
pinfo = O.info (O.helper <*> subcmds) O.fullDesc pinfo = O.info (O.helper <*> subcmds) O.fullDesc
subcmds = O.subparser $ mconcat $ map mkcommand allcmds subcmds = O.hsubparser $ mconcat $ map mkcommand allcmds
mkcommand c = O.command (cmdname c) $ O.info (mkparser c) mkcommand c = O.command (cmdname c) $ O.info (mkparser c)
(O.fullDesc <> O.header (cmddesc c)) (O.fullDesc <> O.header (cmddesc c) <> O.progDesc (cmddesc c))
mkparser c = (,) mkparser c = (,)
<$> pure c <$> pure c
<*> getparser c <*> getparser c