Skip to content

Commit c761312

Browse files
committed
Move check to isAccepted(by:)
1 parent a12a18e commit c761312

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Sources/SwiftOptions/Option.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ extension Option {
135135
public func isAccepted(by driverKind: DriverKind) -> Bool {
136136
switch driverKind {
137137
case .batch:
138-
return !attributes.contains(.noBatch)
138+
return attributes.isDisjoint(with: [.noDriver, .noBatch])
139139
case .interactive:
140-
return !attributes.contains(.noInteractive)
140+
return attributes.isDisjoint(with: [.noDriver, .noInteractive])
141141
}
142142
}
143143
}

Sources/SwiftOptions/OptionTable.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ extension OptionTable {
3737

3838
for option in options {
3939
if option.isAlias { continue }
40-
if option.attributes.contains(.noDriver) { continue }
4140
if option.isHelpHidden && !includeHidden { continue }
4241
guard option.isAccepted(by: driverKind) else { continue }
4342
guard let helpText = option.helpText else { continue }

0 commit comments

Comments
 (0)