Skip to content

Commit

Permalink
cleanup: update property in DefaultHelpTextGenerator for code style c…
Browse files Browse the repository at this point in the history
…onsistency
  • Loading branch information
natemcmaster committed Jul 28, 2019
1 parent 5b097ad commit eb60131
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/CommandLineUtils/HelpText/DefaultHelpTextGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class DefaultHelpTextGenerator : IHelpTextGenerator
/// The hanging indent writer used for formatting indented and wrapped
/// descriptions for options and arguments.
/// </summary>
protected HangingIndentWriter? indentWriter;
protected HangingIndentWriter? IndentWriter { get; set; }

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

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

GenerateUsage(application, output, arguments, options, commands);
GenerateArguments(application, output, arguments, firstColumnWidth);
Expand Down Expand Up @@ -172,7 +172,7 @@ protected virtual void GenerateArguments(

foreach (var arg in visibleArguments)
{
var wrappedDescription = indentWriter!.Write(arg.Description);
var wrappedDescription = IndentWriter?.Write(arg.Description);
var message = string.Format(outputFormat, arg.Name, wrappedDescription);

output.Write(message);
Expand Down Expand Up @@ -202,7 +202,7 @@ protected virtual void GenerateOptions(

foreach (var opt in visibleOptions)
{
var wrappedDescription = indentWriter!.Write(opt.Description);
var wrappedDescription = IndentWriter?.Write(opt.Description);
var message = string.Format(outputFormat, Format(opt), wrappedDescription);

output.Write(message);
Expand Down Expand Up @@ -235,7 +235,7 @@ protected virtual void GenerateCommands(
: visibleCommands;
foreach (var cmd in orderedCommands)
{
var wrappedDescription = indentWriter!.Write(cmd.Description);
var wrappedDescription = IndentWriter?.Write(cmd.Description);
var message = string.Format(outputFormat, cmd.Name, wrappedDescription);

output.Write(message);
Expand Down

0 comments on commit eb60131

Please sign in to comment.