Provides means to format an help screen. You can assign it in place of a System.String instance. More...
Public Member Functions | |
HelpText () | |
Initializes a new instance of the CommandLine.Text.HelpText class. More... | |
HelpText (SentenceBuilder sentenceBuilder) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder. More... | |
HelpText (string heading) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading string. More... | |
HelpText (SentenceBuilder sentenceBuilder, string heading) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder and heading string. More... | |
HelpText (string heading, string copyright) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading and copyright strings. More... | |
HelpText (SentenceBuilder sentenceBuilder, string heading, string copyright) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading and copyright strings. More... | |
HelpText | AddPreOptionsLine (string value) |
Adds a text line after copyright and before options usage strings. More... | |
HelpText | AddPostOptionsLine (string value) |
Adds a text line at the bottom, after options usage string. More... | |
HelpText | AddOptions< T > (T options) |
Adds a text block with options usage string. More... | |
HelpText | AddVerbs (params Type[] types) |
Adds a text block with verbs usage string. More... | |
HelpText | AddOptions< T > (int maximumLength, T options) |
Adds a text block with options usage string. More... | |
HelpText | AddVerbs (int maximumLength, params Type[] types) |
Adds a text block with verbs usage string. More... | |
override string | ToString () |
Returns the help screen as a System.String. More... | |
Static Public Member Functions | |
static HelpText | AutoBuild< T > (ParserResult< T > parserResult, Func< HelpText, HelpText > onError, bool verbsIndex=false) |
Creates a new instance of the CommandLine.Text.HelpText class using common defaults. More... | |
static HelpText | AutoBuild< T > (ParserResult< T > parserResult) |
Creates a new instance of the CommandLine.Text.HelpText class, automatically handling verbs or options scenario. More... | |
static HelpText | DefaultParsingErrorsHandler< T > (ParserResult< T > parserResult, HelpText current) |
Supplies a default parsing error handler implementation. More... | |
static implicit | operator string (HelpText info) |
Converts the help instance to a System.String. More... | |
static string | RenderParsingErrorsText< T > (ParserResult< T > parserResult, Func< Error, string > formatError, int indent) |
Builds a string that contains a parsing error message. More... | |
Properties | |
string | Heading [get, set] |
Gets or sets the heading string. You can directly assign a CommandLine.Text.HeadingInfo instance. More... | |
string | Copyright [get, set] |
Gets or sets the copyright string. You can directly assign a CommandLine.Text.CopyrightInfo instance. More... | |
int | MaximumDisplayWidth [get, set] |
Gets or sets the maximum width of the display. This determines word wrap when displaying the text. More... | |
bool | AddDashesToOption [get, set] |
Gets or sets a value indicating whether the format of options should contain dashes. It modifies behavior of AddOptions{T}(T) method. More... | |
bool | AdditionalNewLineAfterOption [get, set] |
Gets or sets a value indicating whether to add an additional line after the description of the option. More... | |
bool | AddEnumValuesToHelpText [get, set] |
Gets or sets a value indicating whether to add the values of an enum after the description of the option. More... | |
SentenceBuilder | SentenceBuilder [get] |
Gets the SentenceBuilder instance specified in constructor. More... | |
Provides means to format an help screen. You can assign it in place of a System.String instance.
|
inline |
Initializes a new instance of the CommandLine.Text.HelpText class.
|
inline |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder.
sentenceBuilder | A SentenceBuilder instance. |
|
inline |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading string.
heading | An heading string or an instance of CommandLine.Text.HeadingInfo. |
System.ArgumentException | Thrown when parameter heading is null or empty string. |
|
inline |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder and heading string.
sentenceBuilder | A SentenceBuilder instance. |
heading | A string with heading or an instance of CommandLine.Text.HeadingInfo. |
|
inline |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading and copyright strings.
heading | A string with heading or an instance of CommandLine.Text.HeadingInfo. |
copyright | A string with copyright or an instance of CommandLine.Text.CopyrightInfo. |
System.ArgumentNullException | Thrown when one or more parameters are null or empty strings. |
|
inline |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading and copyright strings.
sentenceBuilder | A SentenceBuilder instance. |
heading | A string with heading or an instance of CommandLine.Text.HeadingInfo. |
copyright | A string with copyright or an instance of CommandLine.Text.CopyrightInfo. |
System.ArgumentNullException | Thrown when one or more parameters are null or empty strings. |
|
inline |
Adds a text block with options usage string.
options | The instance that collected command line arguments parsed with Parser class. |
System.ArgumentNullException | Thrown when parameter options is null. |
|
inline |
Adds a text block with options usage string.
maximumLength | The maximum length of the help screen. |
options | The instance that collected command line arguments parsed with the Parser class. |
System.ArgumentNullException | Thrown when parameter options is null. |
|
inline |
Adds a text line at the bottom, after options usage string.
value | A System.String instance. |
System.ArgumentNullException | Thrown when parameter value is null or empty string. |
|
inline |
Adds a text line after copyright and before options usage strings.
value | A System.String instance. |
System.ArgumentNullException | Thrown when parameter value is null or empty string. |
|
inline |
Adds a text block with verbs usage string.
types | The array of System.Type with verb commands. |
System.ArgumentNullException | Thrown when parameter types is null. |
System.ArgumentOutOfRangeException | Thrown if types array is empty. |
|
inline |
Adds a text block with verbs usage string.
maximumLength | The maximum length of the help screen. |
types | The array of System.Type with verb commands. |
System.ArgumentNullException | Thrown when parameter types is null. |
System.ArgumentOutOfRangeException | Thrown if types array is empty. |
|
inlinestatic |
Creates a new instance of the CommandLine.Text.HelpText class using common defaults.
parserResult | The CommandLine.ParserResult{T} containing the instance that collected command line arguments parsed with CommandLine.Parser class. |
onError | A delegate used to customize the text block of reporting parsing errors text block. |
verbsIndex | If true the output style is consistent with verb commands (no dashes), otherwise it outputs options. |
The parameter verbsIndex is not ontly a metter of formatting, it controls whether to handle verbs or options.
|
inlinestatic |
Creates a new instance of the CommandLine.Text.HelpText class, automatically handling verbs or options scenario.
parserResult | The CommandLine.ParserResult{T} containing the instance that collected command line arguments parsed with CommandLine.Parser class. |
This feature is meant to be invoked automatically by the parser, setting the HelpWriter property of CommandLine.ParserSettings.
|
inlinestatic |
Supplies a default parsing error handler implementation.
parserResult | The CommandLine.ParserResult{T} containing the instance that collected command line arguments parsed with CommandLine.Parser class. |
current | The CommandLine.Text.HelpText instance. |
|
inlinestatic |
Converts the help instance to a System.String.
info | This CommandLine.Text.HelpText instance. |
|
inlinestatic |
Builds a string that contains a parsing error message.
parserResult | The CommandLine.ParserResult{T} containing the instance that collected command line arguments parsed with CommandLine.Parser class. |
formatError | The error formatting delegate. |
indent | Number of spaces used to indent text. |
|
inline |
Returns the help screen as a System.String.
|
getset |
Gets or sets a value indicating whether the format of options should contain dashes. It modifies behavior of AddOptions{T}(T) method.
|
getset |
Gets or sets a value indicating whether to add the values of an enum after the description of the option.
|
getset |
Gets or sets a value indicating whether to add an additional line after the description of the option.
|
getset |
Gets or sets the copyright string. You can directly assign a CommandLine.Text.CopyrightInfo instance.
|
getset |
Gets or sets the heading string. You can directly assign a CommandLine.Text.HeadingInfo instance.
|
getset |
Gets or sets the maximum width of the display. This determines word wrap when displaying the text.
The maximum width of the display.
|
get |
Gets the SentenceBuilder instance specified in constructor.