mirror of
https://github.com/ilyakooo0/optparse-applicative.git
synced 2024-11-27 11:56:20 +03:00
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:
parent
7f66f5d464
commit
4a7661a597
@ -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 }
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user