/// <summary> /// Parses a command line string array and invokes the handler for the indicated command. /// </summary> /// <returns>The exit code for the invocation.</returns> public static async Task <int> InvokeAsync( this Parser parser, string[] args, IConsole?console = null, CancellationToken cancellationToken = default) => await parser.Parse(args).InvokeAsync(console, cancellationToken);
public static ParseResult ParseFrom( this System.CommandLine.Parsing.Parser parser, string context, string[] args = null) => parser.Parse(context.Split(' ').Concat(args).ToArray());
/// <summary> /// Parses a command line string array and invokes the handler for the indicated command. /// </summary> /// <returns>The exit code for the invocation.</returns> public static int Invoke( this Parser parser, string[] args, IConsole?console = null) => parser.Parse(args).Invoke(console);