File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ module Options.Applicative (
202202 helpLongEquals ,
203203 helpShowGlobals ,
204204 helpIndent ,
205+ briefHangPoint ,
205206 defaultPrefs ,
206207
207208 -- * Completions
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ module Options.Applicative.Builder (
9090 helpLongEquals ,
9191 helpShowGlobals ,
9292 helpIndent ,
93+ briefHangPoint ,
9394 prefs ,
9495 defaultPrefs ,
9596
@@ -582,6 +583,9 @@ helpShowGlobals = PrefsMod $ \p -> p { prefHelpShowGlobal = True }
582583helpIndent :: Int -> PrefsMod
583584helpIndent w = PrefsMod $ \ p -> p { prefTabulateFill = w }
584585
586+ -- | Set the width at which to hang the brief help text.
587+ briefHangPoint :: Int -> PrefsMod
588+ briefHangPoint php = PrefsMod $ \ p -> p { prefBriefHangPoint = php }
585589
586590
587591-- | Create a `ParserPrefs` given a modifier
@@ -597,7 +601,8 @@ prefs m = applyPrefsMod m base
597601 , prefColumns = 80
598602 , prefHelpLongEquals = False
599603 , prefHelpShowGlobal = False
600- , prefTabulateFill = 24 }
604+ , prefTabulateFill = 24
605+ , prefBriefHangPoint = 35 }
601606
602607-- Convenience shortcuts
603608
Original file line number Diff line number Diff line change @@ -414,7 +414,7 @@ parserUsage pprefs p progn =
414414 hsep
415415 [ pretty " Usage:" ,
416416 pretty progn,
417- hangAtIfOver 9 35 (extractChunk (briefDesc pprefs p))
417+ hangAtIfOver 9 (prefBriefHangPoint pprefs) (extractChunk (briefDesc pprefs p))
418418 ]
419419
420420-- | Peek at the structure of the rendered tree within.
Original file line number Diff line number Diff line change @@ -127,7 +127,8 @@ data ParserPrefs = ParserPrefs
127127 , prefHelpShowGlobal :: Bool -- ^ when displaying subparsers' usage help,
128128 -- show parent options under a "global options"
129129 -- section (default: False)
130- , prefTabulateFill :: Int -- ^ Indentation width for tables
130+ , prefTabulateFill :: Int -- ^ Indentation width for tables
131+ , prefBriefHangPoint :: Int -- ^ Width at which to hang the brief description
131132 } deriving (Eq , Show )
132133
133134data OptName = OptShort ! Char
You can’t perform that action at this time.
0 commit comments