예제 #1
0
 public static Task <int> InvokeAsync(
     this Parser parser,
     string commandLine,
     IConsole?console = null
     ) =>
 parser.InvokeAsync(
     CommandLineStringSplitter.Instance.Split(commandLine).ToArray(),
     console
     );
예제 #2
0
 /// <summary>
 /// Parses a command line string value and invokes the handler for the indicated command.
 /// </summary>
 /// <returns>The exit code for the invocation.</returns>
 /// <remarks>The command line string input will be split into tokens as if it had been passed on the command line.</remarks>
 public static Task <int> InvokeAsync(
     this Parser parser,
     string commandLine,
     IConsole?console = null,
     CancellationToken cancellationToken = default) =>
 parser.InvokeAsync(CommandLineStringSplitter.Instance.Split(commandLine).ToArray(), console, cancellationToken);