Skip to content

Commit 6a5e133

Browse files
committed
Rename Argument -> ShellArgument
1 parent 8e609b6 commit 6a5e133

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public enum Argument: Equatable {
3+
public enum ShellArgument: Equatable {
44
case quoted(QuotedString)
55
case verbatim(String)
66

@@ -13,13 +13,13 @@ public enum Argument: Equatable {
1313
}
1414
}
1515

16-
extension Argument: ExpressibleByStringLiteral {
16+
extension ShellArgument: ExpressibleByStringLiteral {
1717
public init(stringLiteral value: StringLiteralType) {
1818
self = .quoted(.init(value))
1919
}
2020
}
2121

22-
extension Argument: CustomStringConvertible {
22+
extension ShellArgument: CustomStringConvertible {
2323
public var description: String {
2424
switch self {
2525
case let .quoted(value):
@@ -30,17 +30,17 @@ extension Argument: CustomStringConvertible {
3030
}
3131
}
3232

33-
extension Argument {
33+
extension ShellArgument {
3434
public static func url(_ url: URL) -> Self { url.absoluteString.verbatim }
3535
}
3636

3737

3838
extension StringProtocol {
39-
public var quoted: Argument { .init(quoted: self) }
40-
public var verbatim: Argument { .init(verbatim: self) }
39+
public var quoted: ShellArgument { .init(quoted: self) }
40+
public var verbatim: ShellArgument { .init(verbatim: self) }
4141
}
4242

4343
extension Sequence<StringProtocol> {
44-
public var quoted: [Argument] { map(\.quoted) }
45-
public var verbatim: [Argument] { map(\.verbatim) }
44+
public var quoted: [ShellArgument] { map(\.quoted) }
45+
public var verbatim: [ShellArgument] { map(\.verbatim) }
4646
}

Sources/ShellOutCommand+other.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
public extension ShellOutCommand {
2-
static func bash(arguments: [Argument]) -> Self {
2+
static func bash(arguments: [ShellArgument]) -> Self {
33
let arguments = arguments.first == "-c" ? Array(arguments.dropFirst()) : arguments
44
return .init(command: "bash", arguments: ["-c", arguments.map(\.description).joined(separator: " ")])
55
}

Tests/ShellOutTests/ShellOutTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ final class ShellOutTests: XCTestCase {
223223
}
224224

225225
func test_Argument_ExpressibleByStringLiteral() throws {
226-
XCTAssertEqual(("foo" as Argument).description, "foo")
227-
XCTAssertEqual(("foo bar" as Argument).description, "'foo bar'")
226+
XCTAssertEqual(("foo" as ShellArgument).description, "foo")
227+
XCTAssertEqual(("foo bar" as ShellArgument).description, "'foo bar'")
228228
}
229229

230230
func test_Argument_url() throws {
231-
XCTAssertEqual(Argument.url(.init(string: "https://example.com")!).description,
231+
XCTAssertEqual(ShellArgument.url(.init(string: "https://example.com")!).description,
232232
"https://example.com")
233233
}
234234

0 commit comments

Comments
 (0)