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