M_CommandLine_ParserExtensions_ParseArguments__5 - adutton/commandline GitHub Wiki
Parses a string array of command line arguments for verb commands scenario, constructing the proper instance from types as generic arguments. Grammar rules are defined decorating public properties with appropriate attributes. The VerbAttribute must be applied to types in the array.
Namespace: CommandLine
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static ParserResult<Object> ParseArguments<T1, T2, T3, T4, T5>(
this Parser parser,
IEnumerable<string> args
)VB
<ExtensionAttribute>
Public Shared Function ParseArguments(Of T1, T2, T3, T4, T5) (
parser As Parser,
args As IEnumerable(Of String)
) As ParserResult(Of Object)C++
public:
[ExtensionAttribute]
generic<typename T1, typename T2, typename T3, typename T4, typename T5>
static ParserResult<Object^>^ ParseArguments(
Parser^ parser,
IEnumerable<String^>^ args
)F#
[<ExtensionAttribute>]
static member ParseArguments :
parser : Parser *
args : IEnumerable<string> -> ParserResult<Object>
- parser
- Type: CommandLine.Parser
A Parser instance. - args
- Type: System.Collections.Generic.IEnumerable(String)
A String array of command line arguments, normally supplied by application entry point.
- T1
- The type of the first verb.
- T2
- The type of the second verb.
- T3
- The type of the third verb.
- T4
- The type of the fourth verb.
- T5
- The type of the fifth verb.
Type: ParserResult(Object)
A ParserResult(T) containing the appropriate instance with parsed values as a Object and a sequence of Error.
In Visual Basic and C#, you can call this method as an instance method on any object of type Parser. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
| Exception | Condition |
|---|---|
| ArgumentNullException | Thrown if one or more arguments are null. |
All types must expose a parameterless constructor.
ParserExtensions Class
ParseArguments Overload
CommandLine Namespace