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

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!
16 lines
361 B
C#
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; }
|
|
} |