mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00

When a conversion to an enum fails, list all the valid enum values in the error message. Message before this commit: > Error: heimday is not a valid value for DayOfWeek. Message after this commit: > Error: Failed to convert 'heimday' to DayOfWeek. Valid values are 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
12 lines
287 B
C#
12 lines
287 B
C#
namespace Spectre.Console.Tests.Data;
|
|
|
|
[Description("The horse command.")]
|
|
public class HorseCommand : AnimalCommand<HorseSettings>
|
|
{
|
|
public override int Execute(CommandContext context, HorseSettings settings)
|
|
{
|
|
DumpSettings(context, settings);
|
|
return 0;
|
|
}
|
|
}
|