Struct OptionForm
Defines a form for an option.
public struct OptionForm : IEquatable<OptionForm>
- Implements
- Inherited Members
Constructors
OptionForm(string, bool)
Creates an option form.
public OptionForm(string name, bool isShort)
Parameters
Properties
IsShort
Tells if this option form is a short form. Short forms may be treated differently by the option parsed.
public readonly bool IsShort { get; }
Property Value
- bool
trueif the option form is a short form; otherwise,false.
Name
Gets the name of this option form. This does not include any prefixes.
public readonly string Name { get; }
Property Value
- string
The name of the option form.
Methods
Equals(OptionForm)
Checks if this option form equals another.
public bool Equals(OptionForm other)
Parameters
otherOptionFormThe other option form.
Returns
- bool
trueif the option forms are equal; otherwise,false.
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Long(string)
Creates a long option form with a particular name.
public static OptionForm Long(string name)
Parameters
namestringThe option form's name.
Returns
- OptionForm
A long option form.
Parse(string)
Parses an option form from its command-line spelling.
public static OptionForm Parse(string text)
Parameters
textstringThe option form as it appears on the command line, for example
-hor--help.
Returns
- OptionForm
The parsed option form.
Short(string)
Creates a short option form with a particular name.
public static OptionForm Short(string name)
Parameters
namestringThe option form's name.
Returns
- OptionForm
A short option form.
ToString()
public override string ToString()
Returns
Operators
operator ==(OptionForm, OptionForm)
Checks if two option forms are the same.
public static bool operator ==(OptionForm first, OptionForm second)
Parameters
firstOptionFormThe first form to compare.
secondOptionFormThe second form to compare.
Returns
- bool
trueif the first form equals the second; otherwise,false.
operator !=(OptionForm, OptionForm)
Checks if two option forms are different.
public static bool operator !=(OptionForm first, OptionForm second)
Parameters
firstOptionFormThe first form to compare.
secondOptionFormThe second form to compare.
Returns
- bool
trueif the first form does not equal the second; otherwise,false.