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
Syntaxpublic CommandLineParser(
Type argumentsType,
IEnumerable<string> argumentNamePrefixes,
IComparer<string> argumentNameComparer
)
Public Sub New (
argumentsType As Type,
argumentNamePrefixes As IEnumerable(Of String),
argumentNameComparer As IComparer(Of String)
)
Dim argumentsType As Type
Dim argumentNamePrefixes As IEnumerable(Of String)
Dim argumentNameComparer As IComparer(Of String)
Dim instance As New CommandLineParser(argumentsType,
argumentNamePrefixes, argumentNameComparer)
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.
ExceptionsException | Condition |
---|
ArgumentNullException | argumentsType is .
|
ArgumentException | argumentNamePrefixes 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
See Also