Click or drag to resize

CommandLineParser Constructor (Type, IEnumerableString, IComparerString)

Initializes a new instance of the CommandLineParser class using the specified arguments type, the specified argument name prefixes, and the specified IComparerT for comparing argument names.

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

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.
argumentNameComparer
Type: System.Collections.GenericIComparerString
An IComparerT that is used to match the names of arguments, or to use the default case-insensitive comparer.
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.

See Also