Class HangingIndentWriter
A formatter for creating nicely wrapped descriptions for display on the command line in the second column of generated help text.
Inheritance
System.Object
HangingIndentWriter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: McMaster.Extensions.CommandLineUtils.HelpText
Assembly: McMaster.Extensions.CommandLineUtils.dll
Syntax
public class HangingIndentWriter
Constructors
| Improve this Doc View SourceHangingIndentWriter(Int32, Nullable<Int32>, Boolean)
A description formatter for dynamically wrapping the description to print in a CLI usage.
Declaration
public HangingIndentWriter(int indentSize, int? maxLineLength = default(int? ), bool indentFirstLine = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | indentSize | The indent size in spaces to use. |
System.Nullable<System.Int32> | maxLineLength | The max length an indented line can be. Defaults to DefaultConsoleWidth. |
System.Boolean | indentFirstLine | If true, the first line of text will also be indented. |
Fields
| Improve this Doc View SourceDefaultConsoleWidth
The default console width used for wrapping if the width cannot be gotten from the Console.
Declaration
public const int DefaultConsoleWidth = 80
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceWrite(Nullable<String>)
Dynamically wrap text between.
Declaration
public string Write(string? input)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.String> | input | The original description text. |
Returns
Type | Description |
---|---|
System.String | Dynamically wrapped description with explicit newlines preserved. |