converted fsck's options to optparse-applicative
Global options and seeking and key options are still to be done.
This commit is contained in:
parent
b59b8be737
commit
6a88c7c101
4 changed files with 72 additions and 45 deletions
|
@ -75,8 +75,13 @@ 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.idm
|
||||
mkcommand c = O.command (cmdname c) (O.info (mkparser c) O.idm)
|
||||
pinfo = O.info (O.subparser $ mconcat $ map mkcommand allcmds)
|
||||
( O.fullDesc
|
||||
<> O.progDesc "hiya"
|
||||
<> O.header "ook - aaa"
|
||||
)
|
||||
mkcommand c = O.command (cmdname c) $ O.info (mkparser c)
|
||||
(O.fullDesc <> O.progDesc (cmddesc c))
|
||||
mkparser c = (,)
|
||||
<$> pure c
|
||||
<*> getparser c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue