BadScript 2
Loading...
Searching...
No Matches
CommandLine.VerbAttribute Class Reference

Models a verb command specification. More...

Inheritance diagram for CommandLine.VerbAttribute:
CommandLine.Tests.VerbAttributeTests.TestVerbAttribute

Public Member Functions

 VerbAttribute (string name, bool isDefault=false, string[] aliases=null)
 Initializes a new instance of the CommandLine.VerbAttribute class.
 

Properties

string Name [get, private set]
 Gets the verb name.
 
bool Hidden [get, set]
 Gets or sets a value indicating whether a command line verb is visible in the help text.
 
string HelpText [get, set]
 Gets or sets a short description of this command line option. Usually a sentence summary.
 
Type ResourceType [get, set]
 Gets or sets the System.Type that contains the resources for HelpText.
 
bool IsDefault [get, private set]
 Gets whether this verb is the default verb.
 
string[] Aliases [get, private set]
 Gets or sets the aliases.
 

Private Attributes

readonly LocalizableAttributeProperty helpText
 
Type resourceType
 

Detailed Description

Models a verb command specification.

Definition at line 14 of file VerbAttribute.cs.

Constructor & Destructor Documentation

◆ VerbAttribute()

CommandLine.VerbAttribute.VerbAttribute ( string  name,
bool  isDefault = false,
string[]  aliases = null 
)

Initializes a new instance of the CommandLine.VerbAttribute class.

Parameters
nameThe long name of the verb command.
isDefaultWhether the verb is the default verb.
aliasesaliases for this verb. i.e. "move" and "mv"
Exceptions
System.ArgumentExceptionThrown if name is null, empty or whitespace and isDefault is false.

Definition at line 29 of file VerbAttribute.cs.

30 {
31 if (string.IsNullOrWhiteSpace(name))
32 {
33 throw new ArgumentException("name");
34 }
35
36 Name = name;
37 IsDefault = isDefault;
39 resourceType = null;
40 Aliases = aliases ?? new string[0];
41 }
string HelpText
Gets or sets a short description of this command line option. Usually a sentence summary.
string Name
Gets the verb name.
string[] Aliases
Gets or sets the aliases.
readonly LocalizableAttributeProperty helpText
bool IsDefault
Gets whether this verb is the default verb.

Member Data Documentation

◆ helpText

readonly LocalizableAttributeProperty CommandLine.VerbAttribute.helpText
private

Definition at line 16 of file VerbAttribute.cs.

◆ resourceType

Type CommandLine.VerbAttribute.resourceType
private

Definition at line 17 of file VerbAttribute.cs.

Property Documentation

◆ Aliases

string [] CommandLine.VerbAttribute.Aliases
getprivate set

Gets or sets the aliases.

Definition at line 79 of file VerbAttribute.cs.

79{ get; private set; }

◆ HelpText

string CommandLine.VerbAttribute.HelpText
getset

Gets or sets a short description of this command line option. Usually a sentence summary.

Definition at line 56 of file VerbAttribute.cs.

57 {
58 get => helpText.Value ?? string.Empty;
59 set => helpText.Value = value ?? throw new ArgumentNullException("value");
60 }

◆ Hidden

bool CommandLine.VerbAttribute.Hidden
getset

Gets or sets a value indicating whether a command line verb is visible in the help text.

Definition at line 51 of file VerbAttribute.cs.

51{ get; set; }

◆ IsDefault

bool CommandLine.VerbAttribute.IsDefault
getprivate set

Gets whether this verb is the default verb.

Definition at line 74 of file VerbAttribute.cs.

74{ get; private set; }

◆ Name

string CommandLine.VerbAttribute.Name
getprivate set

Gets the verb name.

Definition at line 46 of file VerbAttribute.cs.

46{ get; private set; }

◆ ResourceType

Type CommandLine.VerbAttribute.ResourceType
getset

Gets or sets the System.Type that contains the resources for HelpText.

Definition at line 65 of file VerbAttribute.cs.

66 {
67 get => resourceType;
68 set => resourceType = helpText.ResourceType = value;
69 }

The documentation for this class was generated from the following file: