Skip to content

Commit d8b089c

Browse files
Revert "Revert "Update swift-argument-parser (#32)" (#34)" (#35)
This reverts commit bf9bdfb.
1 parent bf9bdfb commit d8b089c

File tree

4 files changed

+4
-31
lines changed

4 files changed

+4
-31
lines changed

Package.resolved

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/apple/swift-argument-parser",
77
"state": {
88
"branch": null,
9-
"revision": "83b23d940471b313427da226196661856f6ba3e0",
10-
"version": "0.4.4"
9+
"revision": "d2930e8fcf9c33162b9fcc1d522bc975e2d4179b",
10+
"version": "1.0.1"
1111
}
1212
},
1313
{
@@ -51,7 +51,7 @@
5151
"repositoryURL": "https://github.com/apple/swift-markdown.git",
5252
"state": {
5353
"branch": "main",
54-
"revision": "2ba1ed580d18b330f6e89d999b6e09f5f1343fde",
54+
"revision": "9a9050095ec93853c0ed01930a9d108d79dc4776",
5555
"version": null
5656
}
5757
},

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
114114
.package(url: "https://github.com/apple/swift-nio-ssl.git", .upToNextMinor(from: "2.15.0")),
115115
.package(name: "swift-markdown", url: "https://github.com/apple/swift-markdown.git", .branch("main")),
116116
.package(name: "CLMDB", url: "https://github.com/apple/swift-lmdb.git", .branch("main")),
117-
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.4.4")),
117+
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.0.1")),
118118
.package(name: "SymbolKit", url: "https://github.com/apple/swift-docc-symbolkit", .branch("main")),
119119
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMinor(from: "1.1.2")),
120120
]

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,6 @@ extension Docc {
185185
"""))
186186
public var diagnosticLevel: String?
187187

188-
// Parse and ignore any unrecognized flags, options, and input.
189-
//
190-
// When we're adding new flags or options to the `convert` command. This behavior allows us to also land
191-
// changes in other tools that pass these values to `docc convert` without coordinating the two releases.
192-
193-
@Argument(parsing: .unconditionalRemaining, help: .hidden)
194-
var unrecognizedArgumentsAndOptions: [String] = []
195-
196188
// MARK: - Computed Properties
197189

198190
/// The path to the directory that all build output should be placed in.
@@ -222,10 +214,6 @@ extension Docc {
222214
""")
223215
}
224216

225-
if !unrecognizedArgumentsAndOptions.isEmpty {
226-
print("note: The following arguments, options, and flags were not recognized and will be ignored: \(unrecognizedArgumentsAndOptions)")
227-
}
228-
229217
if let outputParent = providedOutputURL?.deletingLastPathComponent() {
230218
var isDirectory: ObjCBool = false
231219
guard FileManager.default.fileExists(atPath: outputParent.path, isDirectory: &isDirectory), isDirectory.boolValue else {

Tests/SwiftDocCUtilitiesTests/ArgumentParsing/ConvertSubcommandTests.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,6 @@ class ConvertSubcommandTests: XCTestCase {
289289
}
290290
}
291291

292-
func testExtraArgumentsAreIgnored() throws {
293-
setenv(TemplateOption.environmentVariableKey, testTemplateURL.path, 1)
294-
295-
let convertOptions = try Docc.Convert.parse([
296-
testBundleURL.path,
297-
// These are unrecognized
298-
"--extra-option", "\"extra value\"",
299-
"--extra-flag",
300-
// This flag is recognized
301-
"--analyze"
302-
])
303-
304-
XCTAssertEqual(convertOptions.unrecognizedArgumentsAndOptions, ["--extra-option", "\"extra value\"", "--extra-flag"])
305-
}
306-
307292
func testIndex() throws {
308293
setenv(TemplateOption.environmentVariableKey, testTemplateURL.path, 1)
309294

0 commit comments

Comments
 (0)