Skip to content

Commit 7426a74

Browse files
committed
Match C++ logic for unknown arguments
1 parent c761312 commit 7426a74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/SwiftOptions/OptionParsing.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ extension OptionTable {
3838
public func parse(_ arguments: [String],
3939
for driverKind: DriverKind) throws -> ParsedOptions {
4040
var trie = PrefixTrie<Option>()
41-
for opt in options {
41+
// Add all options, ignoring the .noDriver ones
42+
for opt in options where !opt.attributes.contains(.noDriver) {
4243
trie[opt.spelling] = opt
4344
}
4445

0 commit comments

Comments
 (0)