refactor: hledgerCommandMode

This commit is contained in:
Simon Michael 2019-01-29 20:36:34 -08:00
parent c719eb7c67
commit 2442b4f46f

View File

@ -246,9 +246,9 @@ type CommandDoc = String
-- flag and argument specs are still required.
hledgerCommandMode :: CommandDoc -> [Flag RawOpts] -> [(String, [Flag RawOpts])]
-> [Flag RawOpts] -> ([Arg RawOpts], Maybe (Arg RawOpts)) -> Mode RawOpts
hledgerCommandMode tmpl unnamedflaggroup namedflaggroups hiddenflaggroup argsdescr =
case parseCommandDoc tmpl of
Nothing -> error' $ "Could not parse help template:\n"++tmpl++"\n"
hledgerCommandMode doc unnamedflaggroup namedflaggroups hiddenflaggroup argsdescr =
case parseCommandDoc doc of
Nothing -> error' $ "Could not parse command doc:\n"++doc++"\n"
Just (names, shorthelp, longhelplines) ->
(defCommandMode names) {
modeHelp = shorthelp