mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-17 01:12:50 +08:00

Also moves tests to `./test` which makes it possible for all test projects to share the same .editorconfig files and similar.
23 lines
549 B
C#
23 lines
549 B
C#
using Spectre.Console.Cli;
|
|
|
|
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();
|
|
}
|
|
}
|
|
} |