Esiur CLI

This commit is contained in:
2026-07-18 00:44:14 +03:00
parent 3e8fb50110
commit ac36a3ddc7
36 changed files with 2396 additions and 304 deletions
+17
View File
@@ -0,0 +1,17 @@
namespace Esiur.CLI;
public enum OutputFormat { Table, Json, JsonLines, Raw }
public static class OutputFormatExtensions
{
public static OutputFormat Parse(string? value) => value?.ToLowerInvariant() switch
{
"table" or null => OutputFormat.Table,
"json" => OutputFormat.Json,
"jsonl" => OutputFormat.JsonLines,
"raw" => OutputFormat.Raw,
_ => throw new CliException(
$"Output format \"{value}\" is invalid. Expected table, json, jsonl, or raw.",
ExitCodes.InvalidArguments),
};
}