diff options
author | Joey Hess <joey@kitenet.net> | 2012-03-15 12:14:45 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-03-15 12:14:45 -0400 |
commit | faf8cede245d19a9af3f62ea9fd576f3b2ba294c (patch) | |
tree | 62a8b5827711e7ec4b7564ea5770bf48f2e630d4 | |
parent | d2769cf7953657ac9ff6ba2acc27cb71a6543c5d (diff) |
fix option order in usage display
-rw-r--r-- | Usage.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -29,8 +29,8 @@ usage header cmds commonoptions = unlines $ -- be displayed after the command. alloptlines = filter (not . null) $ lines $ usageInfo "" $ - concatMap cmdoptions cmds ++ commonoptions - (cmdlines, optlines) = go (sort cmds) alloptlines [] + concatMap cmdoptions scmds ++ commonoptions + (cmdlines, optlines) = go scmds alloptlines [] go [] os ls = (ls, os) go (c:cs) os ls = go cs os' (ls++(l:o)) where @@ -46,6 +46,7 @@ usage header cmds commonoptions = unlines $ namepad = pad $ longest cmdname + 1 descpad = pad $ longest cmdparamdesc + 2 longest f = foldl max 0 $ map (length . f) cmds + scmds = sort cmds {- Descriptions of params used in usage messages. -} paramPaths :: String |