jtr/Jtr.Tools.CLI/SharedCommandOptions.cs
mdnapo 96c203f842
All checks were successful
Run the JSON parser tests / test (push) Has been skipped
Moved UI to separate project, added Dockerfile & renamed project
2024-10-19 12:04:40 +02:00

25 lines
1.1 KiB
C#

using System.CommandLine;
namespace Jtr.Tools.CLI;
public static class SharedCommandOptions
{
public static readonly Option<InputSource> InputOption =
new(aliases: ["--input", "-i"], getDefaultValue: () => InputSource.stdin) { IsRequired = false };
public static readonly Argument<string?> InputArgument =
new(name: "input", description: "The input argument.", getDefaultValue: () => default);
public static readonly Option<FileInfo> InputFileOption = new(
aliases: ["--input-file", "--if"],
description: "Read the input from a file. This option is required when using an input of type file."
);
public static readonly Option<FileInfo> OutputFileOption = new(
aliases: ["--output-file", "--of"],
description: "Write the output to a file. This option is required when using an output of type file."
);
public static readonly Option<OutputOptions> OutputOption =
new(aliases: ["--output", "-o"], getDefaultValue: () => OutputOptions.stdout) { IsRequired = false };
}