refactor: hledgerCommandMode
This commit is contained in:
		
							parent
							
								
									c719eb7c67
								
							
						
					
					
						commit
						2442b4f46f
					
				| @ -246,9 +246,9 @@ type CommandDoc = String | |||||||
| -- flag and argument specs are still required. | -- flag and argument specs are still required. | ||||||
| hledgerCommandMode :: CommandDoc -> [Flag RawOpts] -> [(String, [Flag RawOpts])]  | hledgerCommandMode :: CommandDoc -> [Flag RawOpts] -> [(String, [Flag RawOpts])]  | ||||||
|   -> [Flag RawOpts] -> ([Arg RawOpts], Maybe (Arg RawOpts)) -> Mode RawOpts |   -> [Flag RawOpts] -> ([Arg RawOpts], Maybe (Arg RawOpts)) -> Mode RawOpts | ||||||
| hledgerCommandMode tmpl unnamedflaggroup namedflaggroups hiddenflaggroup argsdescr = | hledgerCommandMode doc unnamedflaggroup namedflaggroups hiddenflaggroup argsdescr = | ||||||
|   case parseCommandDoc tmpl of |   case parseCommandDoc doc of | ||||||
|     Nothing -> error' $ "Could not parse help template:\n"++tmpl++"\n" |     Nothing -> error' $ "Could not parse command doc:\n"++doc++"\n" | ||||||
|     Just (names, shorthelp, longhelplines) -> |     Just (names, shorthelp, longhelplines) -> | ||||||
|       (defCommandMode names) { |       (defCommandMode names) { | ||||||
|          modeHelp        = shorthelp |          modeHelp        = shorthelp | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user