mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	Improve conversion error messages
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'
This commit is contained in:
		@@ -0,0 +1,7 @@
 | 
			
		||||
namespace Spectre.Console.Tests.Data;
 | 
			
		||||
 | 
			
		||||
public class HorseSettings : MammalSettings
 | 
			
		||||
{
 | 
			
		||||
    [CommandOption("-d|--day")]
 | 
			
		||||
    public DayOfWeek Day { get; set; }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user