Skip to content

Instance MethodConsoleKitTerminal

run(_:input:)

Runs an AnyAsyncCommand (AsyncCommandGroup or AsyncCommand) of commands on this Console using the supplied CommandInput.
func run(_ command: any AnyAsyncCommand, input: CommandInput) async throws

Parameters

command

AsyncCommandGroup or AsyncCommand to run.

input

CommandInput to parse CommandOptions and CommandArguments from.

Discussion

try await console.run(group, input: commandInput)

The CommandInput will be mutated, removing any used CommandOptions and CommandArguments. If any excess input is left over after checking the command’s signature, an error will be thrown.