Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

Declaration

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

Summary

Parses the specified command-line arguments into an instance of the specified type. In case of failure, prints usage information to the console and returns default(TArgs). 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 localized 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.
TranslationcmdLineTr Specifies a translation object that contains the localized strings for CommandLineParser’s own text.
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.