Table of Contents

Class HangingIndentWriter

Namespace
McMaster.Extensions.CommandLineUtils.HelpText
Assembly
McMaster.Extensions.CommandLineUtils.dll

A formatter for creating nicely wrapped descriptions for display on the command line in the second column of generated help text.

public class HangingIndentWriter
Inheritance
object
HangingIndentWriter

Constructors

HangingIndentWriter(int, int?, bool)

A description formatter for dynamically wrapping the description to print in a CLI usage.

public HangingIndentWriter(int indentSize, int? maxLineLength = null, bool indentFirstLine = false)

Parameters

indentSize int

The indent size in spaces to use.

maxLineLength int?

The max length an indented line can be. Defaults to DefaultConsoleWidth.

indentFirstLine bool

If true, the first line of text will also be indented.

Fields

DefaultConsoleWidth

The default console width used for wrapping if the width cannot be gotten from the Console.

public const int DefaultConsoleWidth = 80

Field Value

int

Methods

Write(string?)

Dynamically wrap text between.

public string Write(string? input)

Parameters

input string

The original description text.

Returns

string

Dynamically wrapped description with explicit newlines preserved.