CommandLineParser.Parse(ReadOnlyMemory<String>) Method

Parses the specified command line arguments.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.1.0+9df03b6173b5fc9d44dc39638758964dd7a0f4c7
C#
public Object? Parse(
	ReadOnlyMemory<string> args
)

Parameters

args  ReadOnlyMemory<String>
The command line arguments.

Return Value

Object
An instance of the type specified by the ArgumentsType property, or null if argument parsing was canceled by the ArgumentParsed event handler, the CommandLineArgumentAttribute.CancelParsing property, or a method argument that returned CancelMode.Abort or false.

Remarks

If the return value is null, check the HelpRequested property to see if usage help should be displayed.

Exceptions

CommandLineArgumentException An error occurred parsing the command line. Check the CommandLineArgumentException.Category property for the exact reason for the error.

See Also