jtr/DevDisciples.Json.Tools.CLI/JsonPathCommand.CommandOptionsBinder.cs

16 lines
504 B
C#

using System.CommandLine.Binding;
using DevDisciples.Json.Tools.CLI.Extensions;
namespace DevDisciples.Json.Tools.CLI;
public partial class JsonPathCommand
{
public class CommandOptionsBinder : BinderBase<CommandOptions>
{
protected override CommandOptions GetBoundValue(BindingContext context) =>
new CommandOptions
{
PathExpression = context.ParseResult.GetValueForOption(PathExpressionOption)
}.WithCommonBindings(context);
}
}