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

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.
15 lines
330 B
C#
15 lines
330 B
C#
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; }
|
|
} |