CommandInfoCreateInstance Method

Creates an instance of the command type parsing the specified arguments.

Definition

Namespace: Ookii.CommandLine.Commands
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public ICommand? CreateInstance(
	ReadOnlyMemory<string> args
)

Parameters

args  ReadOnlyMemoryString
The arguments to the command.

Return Value

ICommand
An instance of the CommandType, or if an error occurred or parsing was canceled.

Remarks

If the type indicated by the CommandType property implements the ICommandWithCustomParsing parsing interface, an instance of the type is created and the ICommandWithCustomParsingParse(ReadOnlyMemoryString, CommandManager) method invoked. Otherwise, an instance of the type is created using the CommandLineParserT class.

See Also