CommandLineParserParseT Method (String) |
Namespace: Ookii.CommandLine
Exception | Condition |
---|---|
ArgumentNullException | args is . |
CommandLineArgumentException | Too many positional arguments were supplied, a required argument was not supplied, an unknown argument name was supplied, no value was supplied for a named argument, an argument was supplied more than once and AllowDuplicateArguments is , or one of the argument values could not be converted to the argument's type. |
This is a convenience function that instantiates a CommandLineParser, calls Parse(String), and returns the result. If an error occurs, it prints error and usage information to the standard error and output streams using a LineWrappingTextWriter.
If you want more control over the parsing process, including custom error/usage output or handling the ArgumentParsed event, do not use this function; instead perform these steps manually.