CommandExtensions.Invoke Method

Definition

Overloads

Invoke(Command, String, IConsole)

Parses and invokes a command.

Invoke(Command, String[], IConsole)

Parses and invokes a command.

Invoke(Command, String, IConsole)

Parses and invokes a command.

public static int Invoke (this System.CommandLine.Command command, string commandLine, System.CommandLine.IConsole? console = default);
static member Invoke : System.CommandLine.Command * string * System.CommandLine.IConsole -> int
<Extension()>
Public Function Invoke (command As Command, commandLine As String, Optional console As IConsole = Nothing) As Integer

Parameters

command
Command

The command to invoke.

commandLine
String

The command line to parse.

console
IConsole

The console to which output is written during invocation.

Returns

The exit code for the invocation.

Remarks

The command line string input will be split into tokens as if it had been passed on the command line.

Applies to

Invoke(Command, String[], IConsole)

Parses and invokes a command.

public static int Invoke (this System.CommandLine.Command command, string[] args, System.CommandLine.IConsole? console = default);
static member Invoke : System.CommandLine.Command * string[] * System.CommandLine.IConsole -> int
<Extension()>
Public Function Invoke (command As Command, args As String(), Optional console As IConsole = Nothing) As Integer

Parameters

command
Command

The command to invoke.

args
String[]

The arguments to parse.

console
IConsole

The console to which output is written during invocation.

Returns

The exit code for the invocation.

Applies to