4using System.Collections.Generic;
109 public abstract class Error : IEquatable<Error>
127 : this(tag, false) { }
141#region IEquatable<Error> Members
161 return Tag.Equals(other.
Tag);
185 return base.Equals(obj);
213 throw new ArgumentNullException(
"token");
224#region IEquatable<TokenError> Members
269 return base.Equals(obj);
312#region IEquatable<NamedError> Members
357 return base.Equals(obj);
538 "Check if Option or Value attribute values are set properly for the given type.";
546 public const string ErrorMessage =
"At least one option in a group must have value.";
557 public IEnumerable<NameInfo>
Names {
get; }
559#region IEquatable<Error> Members
570 return base.Equals(obj);
575#region IEquatable<MissingGroupOptionError> Members
606 public const string ErrorMessage =
"More than one default verb is not allowed.";
Models an error generated when an unknown verb is detected.
BadVerbSelectedError(string token)
Error(ErrorType tag, bool stopsProcessing)
Initializes a new instance of the CommandLine.Error class.
override bool Equals(object obj)
Determines whether the specified System.Object is equal to the current System.Object.
Error(ErrorType tag)
Initializes a new instance of the CommandLine.Error class.
ErrorType Tag
Error type discriminator, defined as CommandLine.ErrorType enumeration.
override int GetHashCode()
Serves as a hash function for a particular type.
bool Equals(Error other)
Returns a value that indicates whether the current instance and a specified CommandLine....
bool StopsProcessing
Tells if error stops parsing process. Filtered by CommandLine.ErrorExtensions.OnlyMeaningfulOnes(Syst...
GroupOptionAmbiguityError(NameInfo option)
Models an error generated when a user explicitly requests help.
Models an error generated when a user explicitly requests help in verb commands scenario.
Type Type
System.Type of verb command.
HelpVerbRequestedError(string verb, Type type, bool matched)
bool Matched
trueif verb command is found; otherwise false
string Verb
Verb command string.
Models an error generated when an invalid token is detected.
InvalidAttributeConfigurationError()
const string ErrorMessage
MissingGroupOptionError(string group, IEnumerable< NameInfo > names)
bool Equals(MissingGroupOptionError other)
new bool Equals(Error obj)
const string ErrorMessage
IEnumerable< NameInfo > Names
Models an error generated when a required option is required.
MissingRequiredOptionError(NameInfo nameInfo)
Models an error generated when an option lacks its value.
MissingValueOptionError(NameInfo nameInfo)
Models an error generated when multiple default verbs are defined.
MultipleDefaultVerbsError()
const string ErrorMessage
Models an error generated when a an option from another set is defined.
MutuallyExclusiveSetError(NameInfo nameInfo, string setName)
string SetName
Option's set name.
Models name information, used in CommandLine.Error instances.
override int GetHashCode()
Serves as a hash function for a particular type.
bool Equals(NameInfo other)
Returns a value that indicates whether the current instance and a specified CommandLine....
Base type of all erros with name information.
NameInfo NameInfo
Name information relative to this error instance.
NamedError(ErrorType tag, NameInfo nameInfo)
Initializes a new instance of the CommandLine.NamedError class.
bool Equals(NamedError other)
Returns a value that indicates whether the current instance and a specified CommandLine....
override int GetHashCode()
Serves as a hash function for a particular type.
override bool Equals(object obj)
Determines whether the specified System.Object is equal to the current System.Object.
Models an error generated when no verb is selected.
Models an error generated when an option is repeated two or more times.
RepeatedOptionError(NameInfo nameInfo)
Models an error generated when a sequence value lacks elements.
SequenceOutOfRangeError(NameInfo nameInfo)
Models as error generated when exception is thrown at Property.SetValue.
Exception Exception
The expection thrown from Property.SetValue.
SetValueExceptionError(NameInfo nameInfo, Exception exception, object value)
object Value
The value that had to be set to the property.
Base type of all errors related to bad token detection.
TokenError(ErrorType tag, string token)
Initializes a new instance of the CommandLine.TokenError class.
override bool Equals(object obj)
Determines whether the specified System.Object is equal to the current System.Object.
string Token
The string containing the token text.
bool Equals(TokenError other)
Returns a value that indicates whether the current instance and a specified CommandLine....
override int GetHashCode()
Serves as a hash function for a particular type.
Models an error generated when an unknown option is detected.
UnknownOptionError(string token)
Models an error generated when a user explicitly requests version.
ErrorType
Discriminator enumeration of CommandLine.Error derivates.