CommandInfo.CreateInstanceWithResult Method

Creates an instance of the command type.

Definition

Namespace: Ookii.CommandLine.Commands
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 3.1.1
C#
public (ICommand , ParseResult ) CreateInstanceWithResult(
	string[] args,
	int index
)

Parameters

args  String[]
The arguments to the command.
index  Int32
The index in args at which to start parsing the arguments.

Return Value

ValueTuple<ICommand, ParseResult>
A tuple containing an instance of the CommandType, or null if an error occurred or parsing was canceled, and the ParseResult of the operation.

Remarks

The Status property of the returned ParseResult will be None if the command used custom parsing.

Exceptions

ArgumentNullExceptionargs is null.
ArgumentOutOfRangeExceptionindex does not fall inside the bounds of args.

See Also