mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	Add support for converting command parameters into FileInfo and DirectoryInfo (#1145)
Add support for converting command parameters that doesn't have a built-in TypeConverter but has a constructor that takes a string. For CLI apps, FileInfo and DirectoryInfo will likely be the most useful ones, but there may be others.
This commit is contained in:
		@@ -1,7 +1,15 @@
 | 
			
		||||
using System.IO;
 | 
			
		||||
 | 
			
		||||
namespace Spectre.Console.Tests.Data;
 | 
			
		||||
 | 
			
		||||
public class HorseSettings : MammalSettings
 | 
			
		||||
{
 | 
			
		||||
    [CommandOption("-d|--day")]
 | 
			
		||||
    public DayOfWeek Day { get; set; }
 | 
			
		||||
 | 
			
		||||
    [CommandOption("--file")]
 | 
			
		||||
    public FileInfo File { get; set; }
 | 
			
		||||
 | 
			
		||||
    [CommandOption("--directory")]
 | 
			
		||||
    public DirectoryInfo Directory { get; set; }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user