File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,19 @@ public final class CommandRegistry<ClientError: Error> {
86
86
87
87
public init ( ) { }
88
88
89
- /// Registers the given command , making it available to run.
89
+ /// Registers the given commands , making those available to run.
90
90
///
91
- /// If another command was already registered with the same `verb`, it will
92
- /// be overwritten.
93
- public func register< C: CommandProtocol > ( _ command: C ) where C. ClientError == ClientError , C. Options. ClientError == ClientError {
94
- commandsByVerb [ command. verb] = CommandWrapper ( command)
91
+ /// If another commands were already registered with the same `verb`s, those
92
+ /// will be overwritten.
93
+ @discardableResult
94
+ public func register< C: CommandProtocol > ( _ commands: C ... )
95
+ -> CommandRegistry
96
+ where C. ClientError == ClientError , C. Options. ClientError == ClientError
97
+ {
98
+ for command in commands {
99
+ commandsByVerb [ command. verb] = CommandWrapper ( command)
100
+ }
101
+ return self
95
102
}
96
103
97
104
/// Runs the command corresponding to the given verb, passing it the given
You can’t perform that action at this time.
0 commit comments