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