mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Move Spectre.Console.Cli to it's own package
This commit is contained in:

committed by
Patrik Svensson

parent
b600832e00
commit
36ca22ffac
20
test/Spectre.Console.Cli.Tests/Data/Settings/DogSettings.cs
Normal file
20
test/Spectre.Console.Cli.Tests/Data/Settings/DogSettings.cs
Normal file
@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user