Skip to content

Commit c18ac70

Browse files
authored
feature: add UsePagerForHelpText to CommandAttribute. (#343)
Provides the ability to control UsePagerForHelpText using the CommandAttribute.
1 parent ea347af commit c18ac70

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/CommandLineUtils/Attributes/CommandAttribute.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ public string? Name
117117
/// </summary>
118118
public CultureInfo ParseCulture { get; set; } = CultureInfo.CurrentCulture;
119119

120+
/// <summary>
121+
/// Whether a Pager should be used to display help text.
122+
/// </summary>
123+
public bool UsePagerForHelpText { get; set; } = true;
124+
120125
/// <summary>
121126
/// <para>
122127
/// One or more options of <see cref="CommandOptionType.NoValue"/>, followed by at most one option that takes values, should be accepted when grouped behind one '-' delimiter.
@@ -170,6 +175,7 @@ internal void Configure(CommandLineApplication app)
170175
app.UnrecognizedArgumentHandling = UnrecognizedArgumentHandling;
171176
app.OptionsComparison = OptionsComparison;
172177
app.ValueParsers.ParseCulture = ParseCulture;
178+
app.UsePagerForHelpText = UsePagerForHelpText;
173179

174180
if (_clusterOptions.HasValue)
175181
{

src/CommandLineUtils/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ McMaster.Extensions.CommandLineUtils.CommandAttribute.OptionsComparison.get -> S
8888
McMaster.Extensions.CommandLineUtils.CommandAttribute.OptionsComparison.set -> void
8989
McMaster.Extensions.CommandLineUtils.CommandAttribute.ParseCulture.get -> System.Globalization.CultureInfo
9090
McMaster.Extensions.CommandLineUtils.CommandAttribute.ParseCulture.set -> void
91+
McMaster.Extensions.CommandLineUtils.CommandAttribute.UsePagerForHelpText.get -> bool
92+
McMaster.Extensions.CommandLineUtils.CommandAttribute.UsePagerForHelpText.set -> void
9193
McMaster.Extensions.CommandLineUtils.CommandAttribute.ResponseFileHandling.get -> McMaster.Extensions.CommandLineUtils.ResponseFileHandling
9294
McMaster.Extensions.CommandLineUtils.CommandAttribute.ResponseFileHandling.set -> void
9395
McMaster.Extensions.CommandLineUtils.CommandAttribute.ShowInHelpText.get -> bool

0 commit comments

Comments
 (0)