CommandLineParserParseWithErrorHandling Method

Parses the arguments returned by the EnvironmentGetCommandLineArgs method, 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 Object? ParseWithErrorHandling()

Return Value

Object
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.

See Also