12 [AttributeUsage(AttributeTargets.Property)]
19 if (shortName ==
null)
21 throw new ArgumentNullException(
"shortName");
26 throw new ArgumentNullException(
"longName");
40 : this(string.Empty, string.Empty) { }
47 : this(string.Empty, longName) { }
55 : this(shortName.ToOneCharString(), longName) { }
62 : this(shortName.ToOneCharString(), string.Empty) { }
84 throw new ArgumentNullException(
"value");
108 public string Group {
get;
set; } =
string.Empty;
Models a base attribute to define command line syntax.
Models an option specification.
OptionAttribute(string shortName, string longName)
OptionAttribute(string longName)
Initializes a new instance of the CommandLine.OptionAttribute class.
string Group
Gets or sets the option group name. When one or more options are grouped, at least one of them should...
OptionAttribute(char shortName, string longName)
Initializes a new instance of the CommandLine.OptionAttribute class.
OptionAttribute()
Initializes a new instance of the CommandLine.OptionAttribute class. The default long name will be in...
OptionAttribute(char shortName)
Initializes a new instance of the CommandLine.OptionAttribute class.
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.