mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 17:02:51 +08:00
21 lines
460 B
C#
21 lines
460 B
C#
namespace Spectre.Console.Tests.Data;
|
|
|
|
public sealed class DogSettings : MammalSettings
|
|
{
|
|
[CommandArgument(0, "<AGE>")]
|
|
public int Age { get; set; }
|
|
|
|
[CommandOption("-g|--good-boy")]
|
|
public bool GoodBoy { get; set; }
|
|
|
|
public override ValidationResult Validate()
|
|
{
|
|
if (Name == "Tiger")
|
|
{
|
|
return ValidationResult.Error("Tiger is not a dog name!");
|
|
}
|
|
|
|
return ValidationResult.Success();
|
|
}
|
|
}
|