Command data structure tweaking
This commit is contained in:
parent
cdcf0aac71
commit
47be4383b7
3 changed files with 10 additions and 8 deletions
|
@ -67,8 +67,8 @@ usage header cmds options = usageInfo top options ++ commands
|
|||
showcmd c =
|
||||
cmdname c ++
|
||||
pad (longest cmdname + 1) (cmdname c) ++
|
||||
cmdparams c ++
|
||||
pad (longest cmdparams + 2) (cmdparams c) ++
|
||||
cmdparamdesc c ++
|
||||
pad (longest cmdparamdesc + 2) (cmdparamdesc c) ++
|
||||
cmddesc c
|
||||
pad n s = replicate (n - length s) ' '
|
||||
longest f = foldl max 0 $ map (length . f) cmds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue