RaspberryIO/Unosquare.Swan.Lite/Attributes/VerbOptionAttribute.cs
2019-12-04 17:10:06 +01:00

39 lines
1.1 KiB
C#

using System;
namespace Unosquare.Swan.Attributes {
/// <summary>
/// Models a verb option.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class VerbOptionAttribute : Attribute {
/// <summary>
/// Initializes a new instance of the <see cref="VerbOptionAttribute" /> class.
/// </summary>
/// <param name="name">The name.</param>
/// <exception cref="ArgumentNullException">name.</exception>
public VerbOptionAttribute(String name) => this.Name = name ?? throw new ArgumentNullException(nameof(name));
/// <summary>
/// Gets the name of the verb option.
/// </summary>
/// <value>
/// Name.
/// </value>
public String Name {
get;
}
/// <summary>
/// Gets or sets a short description of this command line verb. Usually a sentence summary.
/// </summary>
/// <value>
/// The help text.
/// </value>
public String HelpText {
get; set;
}
/// <inheritdoc />
public override String ToString() => $" {this.Name}\t\t{this.HelpText}";
}
}