display cmdparamdesc in optparse-applicative usage messages

Since optparse-applicative display "FOO" as "[FOO]", the paramOptional
modifier which wrapped it in square brackets was removed from most places.
This commit is contained in:
Joey Hess 2015-07-08 13:39:11 -04:00
parent a2ba701056
commit 3125da54f6
7 changed files with 15 additions and 11 deletions

View file

@ -58,7 +58,7 @@ commandUsage cmd = unlines
{- Descriptions of params used in usage messages. -}
paramPaths :: String
paramPaths = paramOptional $ paramRepeating paramPath -- most often used
paramPaths = paramRepeating paramPath -- most often used
paramPath :: String
paramPath = "PATH"
paramKey :: String
@ -114,6 +114,6 @@ paramNothing = ""
paramRepeating :: String -> String
paramRepeating s = s ++ " ..."
paramOptional :: String -> String
paramOptional s = "[" ++ s ++ "]"
paramOptional s = s
paramPair :: String -> String -> String
paramPair a b = a ++ " " ++ b