summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-15 12:14:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-15 12:14:45 -0400
commitfaf8cede245d19a9af3f62ea9fd576f3b2ba294c (patch)
tree62a8b5827711e7ec4b7564ea5770bf48f2e630d4
parentd2769cf7953657ac9ff6ba2acc27cb71a6543c5d (diff)
fix option order in usage display
-rw-r--r--Usage.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Usage.hs b/Usage.hs
index 59223daae..b1de930ef 100644
--- a/Usage.hs
+++ b/Usage.hs
@@ -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