All checks were successful
Run the JSON parser tests / test (push) Has been skipped
23 lines
728 B
C#
23 lines
728 B
C#
using System.CommandLine;
|
|
using Jtr.Tools.CLI.Extensions;
|
|
|
|
namespace Jtr.Tools.CLI;
|
|
|
|
public class JsonUglifyCommand : Command
|
|
{
|
|
public JsonUglifyCommand() : base("uglify", "Uglify JSON")
|
|
{
|
|
AddAlias("u");
|
|
this.AddInputOutputCommandOptions();
|
|
this.SetHandler(ExecuteAsync, new CommandOptionsBinder());
|
|
}
|
|
|
|
private static async Task ExecuteAsync(CommandOptions options)
|
|
{
|
|
var json = await InputOutputHandler.HandleInput(options.Input, options.InputArgument, options.InputFile);
|
|
|
|
var output = JsonFormatter.Format(json, new() { Beautify = false });
|
|
|
|
await InputOutputHandler.HandleOutput(options.Output, options.OutputFile, output);
|
|
}
|
|
} |