Skip to content

Commit eb60131

Browse files
committed
cleanup: update property in DefaultHelpTextGenerator for code style consistency
1 parent 5b097ad commit eb60131

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/CommandLineUtils/HelpText/DefaultHelpTextGenerator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class DefaultHelpTextGenerator : IHelpTextGenerator
2323
/// The hanging indent writer used for formatting indented and wrapped
2424
/// descriptions for options and arguments.
2525
/// </summary>
26-
protected HangingIndentWriter? indentWriter;
26+
protected HangingIndentWriter? IndentWriter { get; set; }
2727

2828
/// <summary>
2929
/// A singleton instance of <see cref="DefaultHelpTextGenerator" />.
@@ -90,7 +90,7 @@ protected virtual void GenerateBody(
9090
options.Count > 0 ? options.Max(o => Format(o).Length) : 0,
9191
commands.Count > 0 ? commands.Max(c => c.Name?.Length ?? 0) : 0));
9292

93-
indentWriter = new HangingIndentWriter(firstColumnWidth + ColumnSeparatorLength, maxLineLength: TryGetConsoleWidth());
93+
IndentWriter = new HangingIndentWriter(firstColumnWidth + ColumnSeparatorLength, maxLineLength: TryGetConsoleWidth());
9494

9595
GenerateUsage(application, output, arguments, options, commands);
9696
GenerateArguments(application, output, arguments, firstColumnWidth);
@@ -172,7 +172,7 @@ protected virtual void GenerateArguments(
172172

173173
foreach (var arg in visibleArguments)
174174
{
175-
var wrappedDescription = indentWriter!.Write(arg.Description);
175+
var wrappedDescription = IndentWriter?.Write(arg.Description);
176176
var message = string.Format(outputFormat, arg.Name, wrappedDescription);
177177

178178
output.Write(message);
@@ -202,7 +202,7 @@ protected virtual void GenerateOptions(
202202

203203
foreach (var opt in visibleOptions)
204204
{
205-
var wrappedDescription = indentWriter!.Write(opt.Description);
205+
var wrappedDescription = IndentWriter?.Write(opt.Description);
206206
var message = string.Format(outputFormat, Format(opt), wrappedDescription);
207207

208208
output.Write(message);
@@ -235,7 +235,7 @@ protected virtual void GenerateCommands(
235235
: visibleCommands;
236236
foreach (var cmd in orderedCommands)
237237
{
238-
var wrappedDescription = indentWriter!.Write(cmd.Description);
238+
var wrappedDescription = IndentWriter?.Write(cmd.Description);
239239
var message = string.Format(outputFormat, cmd.Name, wrappedDescription);
240240

241241
output.Write(message);

0 commit comments

Comments
 (0)