Skip to content

Commit

Permalink
Add a consumeArg Bool override (#2675)
Browse files Browse the repository at this point in the history
Signed-off-by: Brentley Jones <[email protected]>
  • Loading branch information
brentleyjones authored Oct 10, 2023
1 parent 05688fd commit cbc9042
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tools/generators/lib/PBXProj/src/ConsumeArgs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Foundation
import GeneratorCommon

extension ArraySlice<String> {
// MARK: - consumeArg

public mutating func consumeArg<Output> (
_ type: Output.Type,
in url: URL,
Expand Down Expand Up @@ -83,6 +85,23 @@ extension ArraySlice<String> {
return try transform(rawArg)
}

public mutating func consumeArg(
_ type: Bool.Type,
in url: URL,
file: StaticString = #filePath,
line: UInt = #line
) throws -> Bool {
return try consumeArg(
Bool.self,
in: url,
transform: { $0 == "1" },
file: file,
line: line
)
}

// MARK: - consumeArgs

public mutating func consumeArgs<Output>(
_ type: Output.Type,
count: Int,
Expand Down

0 comments on commit cbc9042

Please sign in to comment.