Models an option specification.
More...
|
string | LongName [get] |
| Gets long name of this command line option. This name is usually a single english word.
|
|
string | ShortName [get] |
| Gets a short name of this command line option, made of one character.
|
|
string | SetName [get, set] |
| Gets or sets the option's mutually exclusive set name.
|
|
bool | FlagCounter [get, set] |
| If true, this is an int option that counts how many times a flag was set (e.g. "-v -v -v" or "-vvv" would return 3). The property must be of type int (signed 32-bit integer).
|
|
char | Separator [get, set] |
| When applying attribute to System.Collections.Generic.IEnumerable<T> target properties, it allows you to split an argument and consume its content as a sequence.
|
|
string | Group = string.Empty [get, set] |
| Gets or sets the option group name. When one or more options are grouped, at least one of them should have value. Required rules are ignored.
|
|
Properties inherited from CommandLine.BaseAttribute |
bool | Required [get, set] |
| Gets or sets a value indicating whether a command line option is required.
|
|
int | Min [get, set] |
| When applied to System.Collections.Generic.IEnumerable<T> properties defines the lower range of items.
|
|
int | Max [get, set] |
| When applied to System.Collections.Generic.IEnumerable<T> properties defines the upper range of items.
|
|
object | Default [get, set] |
| Gets or sets mapped property default value.
|
|
string | HelpText [get, set] |
| Gets or sets a short description of this command line option. Usually a sentence summary.
|
|
string | MetaValue [get, set] |
| Gets or sets mapped property meta value. Usually an uppercase hint of required value type.
|
|
bool | Hidden [get, set] |
| Gets or sets a value indicating whether a command line option is visible in the help text.
|
|
Type | ResourceType [get, set] |
| Gets or sets the System.Type that contains the resources for HelpText.
|
|
Models an option specification.
Definition at line 13 of file OptionAttribute.cs.
◆ OptionAttribute() [1/5]
CommandLine.OptionAttribute.OptionAttribute |
( |
string |
shortName, |
|
|
string |
longName |
|
) |
| |
|
private |
Definition at line 17 of file OptionAttribute.cs.
18 {
19 if (shortName == null)
20 {
21 throw new ArgumentNullException("shortName");
22 }
23
24 if (longName == null)
25 {
26 throw new ArgumentNullException("longName");
27 }
28
33 }
char Separator
When applying attribute to System.Collections.Generic.IEnumerable<T> target properties,...
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.
◆ OptionAttribute() [2/5]
CommandLine.OptionAttribute.OptionAttribute |
( |
| ) |
|
◆ OptionAttribute() [3/5]
CommandLine.OptionAttribute.OptionAttribute |
( |
string |
longName | ) |
|
◆ OptionAttribute() [4/5]
CommandLine.OptionAttribute.OptionAttribute |
( |
char |
shortName, |
|
|
string |
longName |
|
) |
| |
Initializes a new instance of the CommandLine.OptionAttribute class.
- Parameters
-
shortName | The short name of the option. |
longName | The long name of the option or null if not used. |
Definition at line 54 of file OptionAttribute.cs.
55 : this(shortName.ToOneCharString(), longName) { }
◆ OptionAttribute() [5/5]
CommandLine.OptionAttribute.OptionAttribute |
( |
char |
shortName | ) |
|
◆ setName
string CommandLine.OptionAttribute.setName |
|
private |
◆ FlagCounter
bool CommandLine.OptionAttribute.FlagCounter |
|
getset |
If true, this is an int option that counts how many times a flag was set (e.g. "-v -v -v" or "-vvv" would return 3). The property must be of type int (signed 32-bit integer).
Definition at line 96 of file OptionAttribute.cs.
◆ Group
string CommandLine.OptionAttribute.Group = string.Empty |
|
getset |
Gets or sets the option group name. When one or more options are grouped, at least one of them should have value. Required rules are ignored.
Definition at line 108 of file OptionAttribute.cs.
108{ get; set; } = string.Empty;
◆ LongName
string CommandLine.OptionAttribute.LongName |
|
get |
Gets long name of this command line option. This name is usually a single english word.
Definition at line 67 of file OptionAttribute.cs.
◆ Separator
char CommandLine.OptionAttribute.Separator |
|
getset |
When applying attribute to System.Collections.Generic.IEnumerable<T> target properties, it allows you to split an argument and consume its content as a sequence.
Definition at line 102 of file OptionAttribute.cs.
◆ SetName
string CommandLine.OptionAttribute.SetName |
|
getset |
Gets or sets the option's mutually exclusive set name.
Definition at line 77 of file OptionAttribute.cs.
78 {
80 set
81 {
82 if (value == null)
83 {
84 throw new ArgumentNullException("value");
85 }
86
88 }
89 }
◆ ShortName
string CommandLine.OptionAttribute.ShortName |
|
get |
Gets a short name of this command line option, made of one character.
Definition at line 72 of file OptionAttribute.cs.
The documentation for this class was generated from the following file: