CommandLineParserParse(String, Int32) Method

Parses the specified command line arguments, starting at the specified index.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 3.1.1
C#
public Object? Parse(
	string[] args,
	int index = 0
)

Parameters

args  String
The command line arguments.
index  Int32  (Optional)
The index of the first argument to parse.

Return Value

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

Remarks

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

Exceptions

ArgumentNullExceptionargs is .
ArgumentOutOfRangeExceptionindex does not fall within the bounds of args.
CommandLineArgumentException An error occurred parsing the command line. Check the Category property for the exact reason for the error.

See Also