Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove old unavailable APIs #106

Merged
merged 2 commits into from
May 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Commandant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
6C29EE8B1CA6241B0005DA40 /* LinuxSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C29EE8A1CA6241B0005DA40 /* LinuxSupport.swift */; };
6D1EDD381E03E196009BCD2E /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1EDD371E03E196009BCD2E /* Extensions.swift */; };
6D1EDD3A1E03E1F1009BCD2E /* ExtensionsSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D1EDD391E03E1F1009BCD2E /* ExtensionsSpec.swift */; };
CD2ED3411C1E6C5D0076092B /* Argument.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD2ED3401C1E6C5D0076092B /* Argument.swift */; };
Expand Down Expand Up @@ -38,7 +37,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
6C29EE8A1CA6241B0005DA40 /* LinuxSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = LinuxSupport.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
6CAD549C1D371A4E00A2D031 /* LinuxMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LinuxMain.swift; path = Tests/LinuxMain.swift; sourceTree = SOURCE_ROOT; };
6D1EDD371E03E196009BCD2E /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
6D1EDD391E03E1F1009BCD2E /* ExtensionsSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExtensionsSpec.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -241,7 +239,6 @@
D00CCE261A20741300109F8C /* Command.swift */,
D00CCE2A1A20748500109F8C /* Errors.swift */,
D00CCE2E1A2075F700109F8C /* Option.swift */,
6C29EE8A1CA6241B0005DA40 /* LinuxSupport.swift */,
D8169D861ACB942D00923FB0 /* Switch.swift */,
6D1EDD371E03E196009BCD2E /* Extensions.swift */,
);
Expand Down Expand Up @@ -369,7 +366,6 @@
files = (
CD2ED3411C1E6C5D0076092B /* Argument.swift in Sources */,
D0BF14FB1A4C8957003147BC /* HelpCommand.swift in Sources */,
6C29EE8B1CA6241B0005DA40 /* LinuxSupport.swift in Sources */,
CD2ED3431C1E6D540076092B /* ArgumentProtocol.swift in Sources */,
D00CCE2F1A2075F700109F8C /* Option.swift in Sources */,
6D1EDD381E03E196009BCD2E /* Extensions.swift in Sources */,
Expand Down
9 changes: 0 additions & 9 deletions Sources/Commandant/ArgumentProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,3 @@ extension String: ArgumentProtocol {
return string
}
}

// MARK: - migration support
@available(*, unavailable, renamed: "ArgumentProtocol")
public typealias ArgumentType = ArgumentProtocol

extension ArgumentProtocol {
@available(*, unavailable, renamed: "from(string:)")
static func fromString(_ string: String) -> Self? { return nil }
}
22 changes: 0 additions & 22 deletions Sources/Commandant/Command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,3 @@ extension CommandRegistry {
return launchTask("/usr/bin/env", arguments: [ subcommand ] + arguments)
}
}

// MARK: - migration support
@available(*, unavailable, renamed: "CommandProtocol")
public typealias CommandType = CommandProtocol

extension CommandMode {
@available(*, unavailable, renamed: "arguments(_:)")
public static func Arguments(_ parser: ArgumentParser) -> CommandMode {
return .arguments(parser)
}
@available(*, unavailable, renamed: "usage")
public static var Usage: CommandMode {
return .usage
}
}

extension CommandRegistry {
@available(*, unavailable, renamed: "run(command:arguments:)")
public func runCommand(_ verb: String, arguments: [String]) -> Result<(), CommandantError<ClientError>>? {
return run(command: verb, arguments: arguments)
}
}
16 changes: 0 additions & 16 deletions Sources/Commandant/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,3 @@ internal func informativeUsageError<ClientError>(_ option: Option<Bool>) -> Comm
let key = option.key
return informativeUsageError((option.defaultValue ? "--no-\(key)" : "--\(key)"), option: option)
}

// MARK: - migration support
@available(*, unavailable, message: "Use ErrorProtocol instead of ClientErrorType")
public typealias ClientErrorType = Error

extension CommandantError {
@available(*, unavailable, renamed: "usageError(description:)")
public static func UsageError(description: String) -> CommandantError {
return .usageError(description: description)
}

@available(*, unavailable, renamed: "commandError(_:)")
public static func CommandError(_ error: ClientError) -> CommandantError {
return .commandError(error)
}
}
18 changes: 0 additions & 18 deletions Sources/Commandant/LinuxSupport.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/Commandant/Option.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,3 @@ public func <| <ClientError>(mode: CommandMode, option: Option<Bool>) -> Result<
return .failure(informativeUsageError(option))
}
}

// MARK: - migration support
@available(*, unavailable, renamed: "OptionsProtocol")
public typealias OptionsType = OptionsProtocol