Skip to content

Commit af634e9

Browse files
committed
Use variadic parameters
1 parent 7585871 commit af634e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/Commandant/Command.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ public final class CommandRegistry<ClientError: Error> {
9191
/// If another command was already registered with the same `verb`, it will
9292
/// be overwritten.
9393
@discardableResult
94-
public func register<C: CommandProtocol>(_ command: C)
94+
public func register<C: CommandProtocol>(_ commands: C...)
9595
-> CommandRegistry
9696
where C.ClientError == ClientError, C.Options.ClientError == ClientError
9797
{
98-
commandsByVerb[command.verb] = CommandWrapper(command)
98+
for command in commands {
99+
commandsByVerb[command.verb] = CommandWrapper(command)
100+
}
99101
return self
100102
}
101103

0 commit comments

Comments
 (0)