Instance Method
use(_:as:isDefault:)
Adds a
Command instance to the config.mutating func use(_ command: any AnyCommand, as name: String, isDefault: Bool = false)
Parameters
commandSome
AnyCommand. This type will be requested from the service container later.nameA unique name for running this command.
isDefaultIf
true, this command will be set as the default command to run when none other are specified. Setting this overrides any previous default commands.
Discussion
var config = Commands()
config.use(barCommand, as: "bar")