Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: TArgs Parse<TArgs>(string[], TranslationBase, Func<ConsoleColoredString, ConsoleColoredString>)

Declaration

public static TArgs Parse<TArgs>(
    string[] args,
    TranslationBase applicationTr = null,
    Func<ConsoleColoredString, ConsoleColoredString> helpProcessor = null
)

Summary

Parses the specified command-line arguments into an instance of the specified type. See the remarks section of the documentation for CommandLineParser for features and limitations.

Generic type parameters

TArgs The class containing the fields and attributes which define the command-line syntax.

Parameters

string[]args The command-line arguments to be parsed.
TranslationBaseapplicationTr Specifies the application’s translation object which contains the localised strings that document the command-line options and commands. This object is passed in to the FieldNameDoc methods described in the documentation for CommandLineParser. This should be null for monoligual applications.
Func<ConsoleColoredString, ConsoleColoredString>helpProcessor Specifies a callback which is invoked on every documentation string retrieved from the DocumentationAttributes to generate the help text. This callback can modify the text arbitrarily.

Returns

An instance of the class TArgs containing the options and parameters specified by the user on the command line.