diff options
Diffstat (limited to 'CmdLine/Usage.hs')
-rw-r--r-- | CmdLine/Usage.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/CmdLine/Usage.hs b/CmdLine/Usage.hs index 0b1cade05..a6cc90a71 100644 --- a/CmdLine/Usage.hs +++ b/CmdLine/Usage.hs @@ -13,9 +13,12 @@ import Types.Command usageMessage :: String -> String usageMessage s = "Usage: " ++ s -{- Usage message with lists of commands by section. -} usage :: String -> [Command] -> String -usage header cmds = unlines $ usageMessage header : concatMap go [minBound..] +usage header cmds = unlines $ usageMessage header : commandList cmds + +{- Commands listed by section, with breif usage and description. -} +commandList :: [Command] -> [String] +commandList cmds = concatMap go [minBound..] where go section | null cs = [] @@ -39,6 +42,7 @@ usage header cmds = unlines $ usageMessage header : concatMap go [minBound..] longest f = foldl max 0 $ map (length . f) cmds scmds = sort cmds + {- Descriptions of params used in usage messages. -} paramPaths :: String paramPaths = paramRepeating paramPath -- most often used |