Click or drag to resize

CommandLineParser Constructor (Type, IEnumerableString)

Initializes a new instance of the CommandLineParser class using the specified arguments type, the specified argument name prefixes, and the default case-insensitive argument name comparer.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.3.0
Syntax
public CommandLineParser(
	Type argumentsType,
	IEnumerable<string> argumentNamePrefixes
)

Parameters

argumentsType
Type: SystemType
The Type of the class that defines the command line arguments.
argumentNamePrefixes
Type: System.Collections.GenericIEnumerableString
The prefixes that are used to indicate argument names on the command line, or to use the default prefixes for the current platform.
Exceptions
ExceptionCondition
ArgumentNullExceptionargumentsType is .
ArgumentExceptionargumentNamePrefixes contains no elements or contains a or empty string value.
NotSupportedException The CommandLineParser cannot use argumentsType as the command line arguments type, because it defines a required postional argument after an optional positional argument, it defines a positional array argument that is not the last positional argument, it defines an argument with an invalid name, it defines two arguments with the same name, or it has two properties with the same Position property value.
Remarks

If you specify multiple argument name prefixes, the first one will be used when generating usage information using the WriteUsage(TextWriter, Int32, WriteUsageOptions) method.

This constructor uses the OrdinalIgnoreCase comparer for argument names.

See Also