CommandLineParserTParseWithErrorHandling(String) Method

Parses the specified command line arguments and displays error messages and usage help if required.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public T ParseWithErrorHandling(
	string[] args
)

Parameters

args  String
The command line arguments.

Return Value

T
An instance of the type specified by the ArgumentsType property, or if an error occurred, or argument parsing was canceled by the CommandLineArgumentAttributeCancelParsing property or a method argument that returned CancelModeAbort or .

Remarks

If an error occurs or parsing is canceled, it prints errors to the ParseOptionsError stream, and usage help using the UsageWriter if the HelpRequested property is . It then returns .

If the return value is , check the ParseResult property for more information about whether an error occurred or parsing was canceled.

This method will never throw a CommandLineArgumentException exception.

Exceptions

See Also