using System.CommandLine; using System.CommandLine.Invocation; using System.Threading.Tasks; namespace CliFx.Benchmarks.Commands { public class SystemCommandLineCommand { public static int ExecuteHandler(string s, int i, bool b) => 0; public Task ExecuteAsync(string[] args) { var command = new RootCommand { new Option(new[] {"--str", "-s"}) { Argument = new Argument() }, new Option(new[] {"--int", "-i"}) { Argument = new Argument() }, new Option(new[] {"--bool", "-b"}) { Argument = new Argument() } }; command.Handler = CommandHandler.Create(typeof(SystemCommandLineCommand).GetMethod(nameof(ExecuteHandler))); return command.InvokeAsync(args); } } }