CommandLineParserTParseWithErrorHandling 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: 5.0.0+724ca9b7fa5edc075ec2ae65044e61b0d494fd1c
C#
public T ParseWithErrorHandling()

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

Remarks

If an error occurs or parsing is canceled, it prints errors to the ParseOptionsError stream, and usage help using the UsageWriter if the ParseResultHelpRequested 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