Skip to content

Commit dec7934

Browse files
committed
Change CommandRegistry.runCommand(_:arguments:) to CommandRegistry.run(command:arguments:)
#73 (comment)
1 parent 00460d6 commit dec7934

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Sources/Commandant/Command.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public final class CommandRegistry<ClientError: Error> {
9898
/// arguments.
9999
///
100100
/// Returns the results of the execution, or nil if no such command exists.
101-
public func runCommand(_ verb: String, arguments: [String]) -> Result<(), CommandantError<ClientError>>? {
101+
public func run(command verb: String, arguments: [String]) -> Result<(), CommandantError<ClientError>>? {
102102
return self[verb]?.run(ArgumentParser(arguments))
103103
}
104104

@@ -162,7 +162,7 @@ extension CommandRegistry {
162162
arguments.remove(at: 0)
163163
}
164164

165-
switch runCommand(verb, arguments: arguments) {
165+
switch run(command: verb, arguments: arguments) {
166166
case .success?:
167167
exit(EXIT_SUCCESS)
168168

@@ -216,3 +216,10 @@ extension CommandRegistry {
216216
// MARK: - migration support
217217
@available(*, unavailable, renamed: "CommandProtocol")
218218
public typealias CommandType = CommandProtocol
219+
220+
extension CommandRegistry {
221+
@available(*, unavailable, renamed: "run(command:arguments:)")
222+
public func runCommand(_ verb: String, arguments: [String]) -> Result<(), CommandantError<ClientError>>? {
223+
return run(command: verb, arguments: arguments)
224+
}
225+
}

0 commit comments

Comments
 (0)