예제 #1
0
 /// <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);
예제 #2
0
 public static ParseResult ParseFrom(
     this System.CommandLine.Parsing.Parser parser,
     string context,
     string[] args = null) =>
 parser.Parse(context.Split(' ').Concat(args).ToArray());
예제 #3
0
 /// <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);