Add briefDesc modifier for info.

Since `infoFullDesc` is True by default, we need a modifier to change it
to False.
This commit is contained in:
Paolo Capriotti 2012-08-05 13:29:32 +01:00
parent 7f66f5d464
commit 4a7661a597
2 changed files with 7 additions and 2 deletions

View File

@ -63,6 +63,7 @@ module Options.Applicative.Builder (
-- * Builder for 'ParserInfo'
InfoMod,
fullDesc,
briefDesc,
header,
progDesc,
footer,
@ -377,10 +378,14 @@ instance Monoid (InfoMod a) where
mempty = InfoMod id
mappend m1 m2 = InfoMod $ applyInfoMod m2 . applyInfoMod m1
-- | Specify a full description for this parser.
-- | Show a full description in the help text of this parser.
fullDesc :: InfoMod a
fullDesc = InfoMod $ \i -> i { infoFullDesc = True }
-- | Only show a brief description in the help text of this parser.
briefDesc :: InfoMod a
briefDesc = InfoMod $ \i -> i { infoFullDesc = False }
-- | Specify a header for this parser.
header :: String -> InfoMod a
header s = InfoMod $ \i -> i { infoHeader = s }

View File

@ -14,7 +14,7 @@ module Options.Applicative.Extra (
import Control.Applicative
import Options.Applicative.BashCompletion
import Options.Applicative.Common
import Options.Applicative.Builder
import Options.Applicative.Builder hiding (briefDesc)
import Options.Applicative.Help
import Options.Applicative.Internal
import Options.Applicative.Utils