Skip to content

Protocol

CommandGroup

A group of named commands that can be run through a Console.
protocol CommandGroup : AnyCommand, AsyncCommandGroup

Overview

Usually you will use Commands to register commands and create a group.

let console: Console = ...
var input = CommandInput(arguments: CommandLine.arguments)
var context = CommandContext(console: console, input: input)

var config = Commands()
config.use(CowsayCommand(), as: "cowsay")

let group = config.group(help: "Some help for cosway group...")
try console.run(group, with: context)

You can create your own CommandGroup if you want to support custom CommandOptions.

Topics

Instance Properties

Relationships

Inherits From