ValueDescriptionAttribute Class

Supplies a short description of the arguments's value to use when printing usage information.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public class ValueDescriptionAttribute : Attribute
Inheritance
Object    Attribute    ValueDescriptionAttribute

Remarks

The value description is a short, typically one-word description that indicates the type of value that the user should supply.

If this attribute is not present, it is retrieved from the ParseOptionsDefaultValueDescriptions property. If not found there, the type of the argument is used, applying the NameTransform specified by the ParseOptionsValueDescriptionTransform property or the ParseOptionsAttributeValueDescriptionTransform property. If this is a multi-value argument, the element type is used. If the type is NullableT, its underlying type is used.

If you want to override the value description for all arguments of a specific type, use the ParseOptionsDefaultValueDescriptions property.

The value description is used when generating usage help. For example, the usage for an argument named Sample with a value description of String would look like "-Sample <String>".

You can derive from this attribute to use an alternative source for the value description, such as a resource table that can be localized.

  Note

This is not the long description used to describe the purpose of the argument. That can be set using the DescriptionAttribute attribute.

Constructors

ValueDescriptionAttribute Initializes a new instance of the ValueDescriptionAttribute attribute.

Properties

TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)
ValueDescription Gets the value description for the argument.
ValueDescriptionValue Gets the value description stored in this attribute.

Methods

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeReturns the hash code for this instance.
(Inherited from Attribute)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute)
MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also