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.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
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