4using System.Collections.Generic;
23 IEnumerable<string> enumValues,
27 bool flagCounter =
false,
38 conversionType == typeof(int) && flagCounter ?
TargetType.
Switch : targetType,
68 IEnumerable<string> enumValues)
75 attribute.Max == -1 ?
Maybe.Nothing<
int>() :
Maybe.Just(attribute.
Max),
82 conversionType.ToTargetType(),
100 Maybe.Nothing<
int>(),
101 Maybe.Nothing<
int>(),
103 Maybe.Nothing<
object>(),
106 Enumerable.Empty<
string>(),
The Maybe type models an optional value. A value of type Maybe a either contains a value of type a (r...
int Min
When applied to System.Collections.Generic.IEnumerable<T> properties defines the lower range of items...
bool Required
Gets or sets a value indicating whether a command line option is required.
string MetaValue
Gets or sets mapped property meta value. Usually an uppercase hint of required value type.
int Max
When applied to System.Collections.Generic.IEnumerable<T> properties defines the upper range of items...
string HelpText
Gets or sets a short description of this command line option. Usually a sentence summary.
object Default
Gets or sets mapped property default value.
OptionSpecification(string shortName, string longName, bool required, string setName, Maybe< int > min, Maybe< int > max, char separator, Maybe< object > defaultValue, string helpText, string metaValue, IEnumerable< string > enumValues, Type conversionType, TargetType targetType, string group, bool flagCounter=false, bool hidden=false)
static OptionSpecification FromAttribute(OptionAttribute attribute, Type conversionType, IEnumerable< string > enumValues)
static OptionSpecification NewSwitch(string shortName, string longName, bool required, string helpText, string metaValue, bool hidden=false)
bool FlagCounter
Whether this is an int option that counts how many times a flag was set rather than taking a value on...
Models an option specification.
string Group
Gets or sets the option group name. When one or more options are grouped, at least one of them should...
char Separator
When applying attribute to System.Collections.Generic.IEnumerable<T> target properties,...
string SetName
Gets or sets the option's mutually exclusive set name.
bool FlagCounter
If true, this is an int option that counts how many times a flag was set (e.g. "-v -v -v" or "-vvv" w...
string ShortName
Gets a short name of this command line option, made of one character.
string LongName
Gets long name of this command line option. This name is usually a single english word.