Skip to content

M_CommandLine_Parser_ParseArguments__1_1

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

Parser.ParseArguments(T) Method (Func(T), IEnumerable(String))

Parses a string array of command line arguments constructing values in an instance of type T. Grammar rules are defined decorating public properties with appropriate attributes.

Namespace:CommandLine
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

publicParserResult<T>ParseArguments<T>(Func<T>factory,IEnumerable<string>args)whereT:new()

VB

PublicFunctionParseArguments(OfTAsNew)(factoryAsFunc(OfT),argsAsIEnumerable(OfString))AsParserResult(OfT)

C++

public: generic<typename T> where T : gcnew() ParserResult<T>^ ParseArguments( Func<T>^ factory, IEnumerable<String^>^ args )

F#

memberParseArguments:factory :Func<'T>* args : IEnumerable<string>-> ParserResult<'T> when 'T : new()

Parameters

factory
Type: System.Func(T)
A Func(TResult) delegate used to initialize the target instance.
args
Type: System.Collections.Generic.IEnumerable(String)
A String array of command line arguments, normally supplied by application entry point.

Type Parameters

T
Type of the target instance built with parsed value.

Return Value

Type: ParserResult(T)
A ParserResult(T) containing an instance of type T with parsed values and a sequence of Error.

Exceptions

ExceptionCondition
ArgumentNullExceptionThrown if one or more arguments are null.

See Also

Reference

Parser Class
ParseArguments Overload
CommandLine Namespace

Clone this wiki locally