25 lines
1.1 KiB
C#
25 lines
1.1 KiB
C#
using System.CommandLine;
|
|
|
|
namespace DevDisciples.Json.Tools.CLI;
|
|
|
|
public static class SharedCommandOptions
|
|
{
|
|
public static readonly Option<InputOptions> InputOption =
|
|
new(aliases: ["--input", "-i"], getDefaultValue: () => InputOptions.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 };
|
|
} |