Cédric Luthi 5296e56b1c
Fix DefaultValue for FileInfo and DirectoryInfo (#1238)
Commit d3f4f5f208ee76a22ff39c13df4d150712685f5f introduced automatic conversion to FileInfo and DirectoryInfo but failed to properly handle the conversion if the value comes from the [DefaultValue] attribute.

Using both `var (converter, stringConstructor) = GetConverter(...)` and `var (converter, _) = GetConverter(...)` should have been a red flag!
2023-09-21 12:05:42 +01:00

16 lines
361 B
C#

using System.IO;
namespace Spectre.Console.Tests.Data;
public class HorseSettings : MammalSettings
{
[CommandOption("-d|--day")]
public DayOfWeek Day { get; set; }
[CommandOption("--file")]
[DefaultValue("food.txt")]
public FileInfo File { get; set; }
[CommandOption("--directory")]
public DirectoryInfo Directory { get; set; }
}