order commands in usage by name

This commit is contained in:
Joey Hess 2012-02-16 16:53:44 -04:00
parent db6b4cdfcf
commit 990fcad978
2 changed files with 11 additions and 1 deletions

View file

@ -7,6 +7,7 @@
module Usage where
import Common.Annex
import System.Console.GetOpt
import Types.Command
@ -30,7 +31,7 @@ usage header cmds commonoptions = unlines $
alloptlines = filter (not . null) $
lines $ usageInfo "" $
concatMap cmdoptions cmds ++ commonoptions
(cmdlines, optlines) = go cmds alloptlines []
(cmdlines, optlines) = go (sort cmds) alloptlines []
go [] os ls = (ls, os)
go (c:cs) os ls = go cs os' (ls++(l:o))
where