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
-
objectHangingIndentWriter
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
indentSizeintThe indent size in spaces to use.
maxLineLengthint?The max length an indented line can be. Defaults to DefaultConsoleWidth.
indentFirstLineboolIf 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
Methods
Write(string?)
Dynamically wrap text between.
public string Write(string? input)
Parameters
inputstringThe original description text.
Returns
- string
Dynamically wrapped description with explicit newlines preserved.