Instance Method
use(_:as:isDefault:)
Adds an
AsyncCommand instance to the config.mutating func use(_ command: any AnyAsyncCommand, as name: String, isDefault: Bool = false)
Parameters
commandSome
AnyAsyncCommand. 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 = AsyncCommands()
config.use(barCommand, as: "bar")