Skip to content

M_CommandLine_ParserExtensions_ParseArguments__5

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

ParserExtensions.ParseArguments(T1, T2, T3, T4, T5) Method (Parser, IEnumerable(String))

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

Syntax

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> 

Parameters

 

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.

Type Parameters

 

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.

Return Value

Type: ParserResult(Object)
A ParserResult(T) containing the appropriate instance with parsed values as a Object and a sequence of Error.

Usage Note

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).

Exceptions

 

Exception Condition
ArgumentNullException Thrown if one or more arguments are null.

Remarks

All types must expose a parameterless constructor.

See Also

Reference

ParserExtensions Class
ParseArguments Overload
CommandLine Namespace

Clone this wiki locally