![]() |
BadScript 2
|
Public Member Functions | |
HelpText () | |
Initializes a new instance of the CommandLine.Text.HelpText class. | |
HelpText (SentenceBuilder sentenceBuilder) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder. | |
HelpText (string heading) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading string. | |
HelpText (SentenceBuilder sentenceBuilder, string heading) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder and heading string. | |
HelpText (string heading, string copyright) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading and copyright strings. | |
HelpText (SentenceBuilder sentenceBuilder, string heading, string copyright) | |
Initializes a new instance of the CommandLine.Text.HelpText class specifying heading and copyright strings. | |
HelpText | AddPreOptionsLine (string value) |
Adds a text line after copyright and before options usage strings. | |
HelpText | AddPostOptionsLine (string value) |
Adds a text line at the bottom, after options usage string. | |
HelpText | AddPreOptionsLines (IEnumerable< string > lines) |
Adds text lines after copyright and before options usage strings. | |
HelpText | AddPostOptionsLines (IEnumerable< string > lines) |
Adds text lines at the bottom, after options usage string. | |
HelpText | AddPreOptionsText (string text) |
Adds a text block of lines after copyright and before options usage strings. | |
HelpText | AddPostOptionsText (string text) |
Adds a text block of lines at the bottom, after options usage string. | |
HelpText | AddOptions< T > (ParserResult< T > result) |
Adds a text block with options usage string. | |
HelpText | AddVerbs (params Type[] types) |
Adds a text block with verbs usage string. | |
HelpText | AddOptions< T > (int maximumLength, ParserResult< T > result) |
Adds a text block with options usage string. | |
HelpText | AddVerbs (int maximumLength, params Type[] types) |
Adds a text block with verbs usage string. | |
override string | ToString () |
Returns the help screen as a System.String. | |
Static Public Member Functions | |
static HelpText | AutoBuild< T > (ParserResult< T > parserResult, Func< HelpText, HelpText > onError, Func< Example, Example > onExample, bool verbsIndex=false, int maxDisplayWidth=DefaultMaximumLength) |
Creates a new instance of the CommandLine.Text.HelpText class using common defaults. | |
static HelpText | AutoBuild< T > (ParserResult< T > parserResult, int maxDisplayWidth=DefaultMaximumLength) |
Creates a default instance of the CommandLine.Text.HelpText class, automatically handling verbs or options scenario. | |
static HelpText | AutoBuild< T > (ParserResult< T > parserResult, Func< HelpText, HelpText > onError, int maxDisplayWidth=DefaultMaximumLength) |
Creates a custom instance of the CommandLine.Text.HelpText class, automatically handling verbs or options scenario. | |
static HelpText | DefaultParsingErrorsHandler< T > (ParserResult< T > parserResult, HelpText current) |
Supplies a default parsing error handler implementation. | |
static implicit | operator string (HelpText info) |
Converts the help instance to a System.String. | |
static string | RenderParsingErrorsText< T > (ParserResult< T > parserResult, Func< Error, string > formatError, Func< IEnumerable< MutuallyExclusiveSetError >, string > formatMutuallyExclusiveSetErrors, int indent) |
Builds a string that contains a parsing error message. | |
static IEnumerable< string > | RenderParsingErrorsTextAsLines< T > (ParserResult< T > parserResult, Func< Error, string > formatError, Func< IEnumerable< MutuallyExclusiveSetError >, string > formatMutuallyExclusiveSetErrors, int indent) |
Builds a sequence of string that contains a parsing error message. | |
static string | RenderUsageText< T > (ParserResult< T > parserResult) |
Builds a string with usage text block created using CommandLine.Text.UsageAttribute data and metadata. | |
static string | RenderUsageText< T > (ParserResult< T > parserResult, Func< Example, Example > mapperFunc) |
Builds a string with usage text block created using CommandLine.Text.UsageAttribute data and metadata. | |
static IEnumerable< string > | RenderUsageTextAsLines< T > (ParserResult< T > parserResult, Func< Example, Example > mapperFunc) |
Builds a string sequence with usage text block created using CommandLine.Text.UsageAttribute data and metadata. | |
Static Public Attributes | |
static Comparison< ComparableOption > | RequiredThenAlphaComparison |
Static Package Functions | |
static void | AddLine (StringBuilder builder, string value, int maximumLength) |
Properties | |
string | Heading [get, set] |
Gets or sets the heading string. You can directly assign a CommandLine.Text.HeadingInfo instance. | |
string | Copyright [get, set] |
Gets or sets the copyright string. You can directly assign a CommandLine.Text.CopyrightInfo instance. | |
int | MaximumDisplayWidth [get, set] |
Gets or sets the maximum width of the display. This determines word wrap when displaying the text. | |
bool | AddDashesToOption [get, set] |
Gets or sets a value indicating whether the format of options should contain dashes. It modifies behavior of AddOptions<T>(ParserResult<T>) method. | |
bool | AdditionalNewLineAfterOption [get, set] |
Gets or sets a value indicating whether to add an additional line after the description of the specification. | |
bool | AddNewLineBetweenHelpSections [get, set] |
Gets or sets a value indicating whether to add newlines between help sections. | |
bool | AddEnumValuesToHelpText [get, set] |
Gets or sets a value indicating whether to add the values of an enum after the description of the specification. | |
bool | AutoHelp [get, set] |
Gets or sets a value indicating whether implicit option or verb 'help' should be supported. | |
bool | AutoVersion [get, set] |
Gets or sets a value indicating whether implicit option or verb 'version' should be supported. | |
SentenceBuilder | SentenceBuilder [get] |
Gets the SentenceBuilder instance specified in constructor. | |
Comparison< ComparableOption > | OptionComparison = null [get, set] |
Private Member Functions | |
IEnumerable< Specification > | GetSpecificationsFromType (Type type) |
IEnumerable< Specification > | AdaptVerbsToSpecifications (IEnumerable< Type > types) |
HelpText | AddOptionsImpl (IEnumerable< Specification > specifications, string requiredWord, string optionGroupWord, int maximumLength) |
OptionSpecification | MakeHelpEntry () |
OptionSpecification | MakeVersionEntry () |
HelpText | AddPreOptionsLine (string value, int maximumLength) |
HelpText | AddOption (string requiredWord, string optionGroupWord, int maxLength, Specification specification, int widthOfHelpText) |
string | AddOptionName (int maxLength, OptionSpecification specification) |
string | AddValueName (int maxLength, ValueSpecification specification) |
HelpText | AddLine (StringBuilder builder, string value) |
int | GetMaxLength (IEnumerable< Specification > specifications) |
int | GetMaxOptionLength (OptionSpecification spec) |
int | GetMaxValueLength (ValueSpecification spec) |
ComparableOption | ToComparableOption (Specification spec, int index) |
Static Private Member Functions | |
static Maybe< Tuple< UsageAttribute, IEnumerable< Example > > > | GetUsageFromType (Type type) |
static string | FormatDefaultValue< T > (T value) |
Private Attributes | |
readonly StringBuilder | postOptionsHelp |
readonly StringBuilder | preOptionsHelp |
string | copyright |
string | heading |
StringBuilder | optionsHelp |
Static Private Attributes | |
const int | BuilderCapacity = 128 |
const int | DefaultMaximumLength = 80 |
const int | OptionToHelpTextSeparatorWidth = 4 |
The number of spaces between an option and its associated help text. | |
const int | OptionPrefixWidth = 2 |
The width of the option prefix (either "--" or " ". | |
const int | TotalOptionPadding = OptionToHelpTextSeparatorWidth + OptionPrefixWidth |
The total amount of extra space that needs to accounted for when indenting Option help text. | |
Definition at line 32 of file HelpText.cs.
CommandLine.Text.HelpText.HelpText | ( | ) |
Initializes a new instance of the CommandLine.Text.HelpText class.
Definition at line 61 of file HelpText.cs.
CommandLine.Text.HelpText.HelpText | ( | SentenceBuilder | sentenceBuilder | ) |
Initializes a new instance of the CommandLine.Text.HelpText class specifying the sentence builder.
sentenceBuilder | A SentenceBuilder instance. |
Definition at line 71 of file HelpText.cs.
CommandLine.Text.HelpText.HelpText | ( | string | heading | ) |
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. |
Definition at line 80 of file HelpText.cs.
CommandLine.Text.HelpText.HelpText | ( | SentenceBuilder | sentenceBuilder, |
string | heading | ||
) |
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. |
Definition at line 89 of file HelpText.cs.
CommandLine.Text.HelpText.HelpText | ( | string | heading, |
string | copyright | ||
) |
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. |
Definition at line 99 of file HelpText.cs.
CommandLine.Text.HelpText.HelpText | ( | SentenceBuilder | sentenceBuilder, |
string | heading, | ||
string | copyright | ||
) |
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. |
Definition at line 110 of file HelpText.cs.
|
private |
Definition at line 949 of file HelpText.cs.
|
private |
Definition at line 1161 of file HelpText.cs.
|
staticpackage |
Definition at line 879 of file HelpText.cs.
|
private |
Definition at line 1046 of file HelpText.cs.
|
private |
Definition at line 1127 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddOptions< T > | ( | int | maximumLength, |
ParserResult< T > | result | ||
) |
Adds a text block with options usage string.
maximumLength | The maximum length of the help screen. |
result | A parsing computation result. |
System.ArgumentNullException | Thrown when parameter result is null. |
Definition at line 614 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddOptions< T > | ( | ParserResult< T > | result | ) |
Adds a text block with options usage string.
result | A parsing computation result. |
System.ArgumentNullException | Thrown when parameter result is null. |
Definition at line 569 of file HelpText.cs.
|
private |
Definition at line 977 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddPostOptionsLine | ( | string | value | ) |
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. |
Definition at line 505 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddPostOptionsLines | ( | IEnumerable< string > | lines | ) |
Adds text lines at the bottom, after options usage string.
lines | A System.String sequence of line to add. |
Definition at line 527 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddPostOptionsText | ( | string | text | ) |
Adds a text block of lines at the bottom, after options usage string.
text | A System.String text block. |
Definition at line 554 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddPreOptionsLine | ( | string | value | ) |
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. |
Definition at line 494 of file HelpText.cs.
|
private |
Definition at line 1039 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddPreOptionsLines | ( | IEnumerable< string > | lines | ) |
Adds text lines after copyright and before options usage strings.
lines | A System.String sequence of line to add. |
Definition at line 515 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddPreOptionsText | ( | string | text | ) |
Adds a text block of lines after copyright and before options usage strings.
text | A System.String text block. |
Definition at line 539 of file HelpText.cs.
|
private |
Definition at line 1147 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddVerbs | ( | int | maximumLength, |
params Type[] | types | ||
) |
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. |
Definition at line 635 of file HelpText.cs.
HelpText CommandLine.Text.HelpText.AddVerbs | ( | params Type[] | types | ) |
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. |
Definition at line 589 of file HelpText.cs.
|
static |
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. |
onExample | A delegate used to customize CommandLine.Text.Example model used to render text block of usage examples. |
verbsIndex | If true the output style is consistent with verb commands (no dashes), otherwise it outputs options. |
maxDisplayWidth | The maximum width of the display. |
The parameter verbsIndex is not ontly a metter of formatting, it controls whether to handle verbs or options.
Definition at line 253 of file HelpText.cs.
|
static |
Creates a custom 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. |
onError | A delegate used to customize the text block of reporting parsing errors text block. |
maxDisplayWidth | The maximum width of the display. |
This feature is meant to be invoked automatically by the parser, setting the HelpWriter property of CommandLine.ParserSettings.
Definition at line 371 of file HelpText.cs.
|
static |
Creates a default 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. |
maxDisplayWidth | The maximum width of the display. |
This feature is meant to be invoked automatically by the parser, setting the HelpWriter property of CommandLine.ParserSettings.
Definition at line 349 of file HelpText.cs.
|
static |
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. |
Definition at line 443 of file HelpText.cs.
|
staticprivate |
Definition at line 1266 of file HelpText.cs.
|
private |
Definition at line 1168 of file HelpText.cs.
|
private |
Definition at line 1188 of file HelpText.cs.
|
private |
Definition at line 1234 of file HelpText.cs.
|
private |
Definition at line 902 of file HelpText.cs.
|
staticprivate |
Definition at line 928 of file HelpText.cs.
|
private |
Definition at line 1019 of file HelpText.cs.
|
private |
Definition at line 1029 of file HelpText.cs.
|
static |
Converts the help instance to a System.String.
info | This CommandLine.Text.HelpText instance. |
Definition at line 483 of file HelpText.cs.
|
static |
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. |
formatMutuallyExclusiveSetErrors | The specialized CommandLine.MutuallyExclusiveSetError sequence formatting delegate. |
indent | Number of spaces used to indent text. |
Definition at line 668 of file HelpText.cs.
|
static |
Builds a sequence of 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. |
formatMutuallyExclusiveSetErrors | The specialized CommandLine.MutuallyExclusiveSetError sequence formatting delegate. |
indent | Number of spaces used to indent text. |
Definition at line 697 of file HelpText.cs.
|
static |
Builds a string with usage text block created using CommandLine.Text.UsageAttribute data and metadata.
T | Type of parsing computation result. |
parserResult | A parsing computation result. |
Definition at line 750 of file HelpText.cs.
|
static |
Builds a string with usage text block created using CommandLine.Text.UsageAttribute data and metadata.
T | Type of parsing computation result. |
parserResult | A parsing computation result. |
mapperFunc | A mapping lambda normally used to translate text in other languages. |
Definition at line 763 of file HelpText.cs.
|
static |
Builds a string sequence with usage text block created using CommandLine.Text.UsageAttribute data and metadata.
T | Type of parsing computation result. |
parserResult | A parsing computation result. |
mapperFunc | A mapping lambda normally used to translate text in other languages. |
Definition at line 776 of file HelpText.cs.
|
private |
Definition at line 1302 of file HelpText.cs.
override string CommandLine.Text.HelpText.ToString | ( | ) |
Returns the help screen as a System.String.
Definition at line 830 of file HelpText.cs.
|
staticprivate |
Definition at line 34 of file HelpText.cs.
|
private |
Definition at line 54 of file HelpText.cs.
|
staticprivate |
Definition at line 35 of file HelpText.cs.
|
private |
Definition at line 55 of file HelpText.cs.
|
staticprivate |
The width of the option prefix (either "--" or " ".
Definition at line 45 of file HelpText.cs.
|
private |
Definition at line 56 of file HelpText.cs.
|
staticprivate |
The number of spaces between an option and its associated help text.
Definition at line 40 of file HelpText.cs.
|
private |
Definition at line 52 of file HelpText.cs.
|
private |
Definition at line 53 of file HelpText.cs.
|
static |
Definition at line 1322 of file HelpText.cs.
|
staticprivate |
The total amount of extra space that needs to accounted for when indenting Option help text.
Definition at line 50 of file HelpText.cs.
|
getset |
Gets or sets a value indicating whether the format of options should contain dashes. It modifies behavior of AddOptions<T>(ParserResult<T>) method.
Definition at line 197 of file HelpText.cs.
|
getset |
Gets or sets a value indicating whether to add the values of an enum after the description of the specification.
Definition at line 212 of file HelpText.cs.
|
getset |
Gets or sets a value indicating whether to add an additional line after the description of the specification.
Definition at line 202 of file HelpText.cs.
|
getset |
Gets or sets a value indicating whether to add newlines between help sections.
Definition at line 207 of file HelpText.cs.
|
getset |
Gets or sets a value indicating whether implicit option or verb 'help' should be supported.
Definition at line 217 of file HelpText.cs.
|
getset |
Gets or sets a value indicating whether implicit option or verb 'version' should be supported.
Definition at line 222 of file HelpText.cs.
|
getset |
Gets or sets the copyright string. You can directly assign a CommandLine.Text.CopyrightInfo instance.
Definition at line 173 of file HelpText.cs.
|
getset |
Gets or sets the heading string. You can directly assign a CommandLine.Text.HeadingInfo instance.
Definition at line 155 of file HelpText.cs.
|
getset |
Gets or sets the maximum width of the display. This determines word wrap when displaying the text.
The maximum width of the display.
Definition at line 191 of file HelpText.cs.
|
getset |
Definition at line 1320 of file HelpText.cs.
|
get |
Gets the SentenceBuilder instance specified in constructor.
Definition at line 227 of file HelpText.cs.