Skip to content

Instance MethodConsoleKitTerminal

run(_:input:)

Runs an AnyCommand (CommandGroup or Command) of commands on this Console using the supplied CommandInput.
func run(_ command: any AnyCommand, input: CommandInput) throws

Parameters

command

CommandGroup or Command to run.

input

CommandInput to parse CommandOptions and CommandArguments from.

Discussion

try 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.