File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Sources/SwiftDriver/Driver Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ extension Driver {
548
548
// We just need to invoke the corresponding tool if the kind isn't Swift compiler.
549
549
guard driverKind. isSwiftCompiler else {
550
550
let swiftCompiler = try getSwiftCompilerPath ( )
551
- return try exec ( path: swiftCompiler. pathString, args: [ " swift " ] + parsedOptions. commandLine)
551
+ return try exec ( path: swiftCompiler. pathString, args: driverKind . usageArgs + parsedOptions. commandLine)
552
552
}
553
553
554
554
if parsedOptions. contains ( . help) || parsedOptions. contains ( . helpHidden) {
Original file line number Diff line number Diff line change @@ -48,6 +48,28 @@ extension DriverKind {
48
48
}
49
49
}
50
50
51
+ public var usageArgs : [ String ] {
52
+ switch self {
53
+ case . autolinkExtract:
54
+ return [ " swift-autolink-extract " ]
55
+
56
+ case . batch:
57
+ return [ " swiftc " ]
58
+
59
+ case . frontend:
60
+ return [ " swift " , " -frontend " ]
61
+
62
+ case . indent:
63
+ return [ " swift-indent " ]
64
+
65
+ case . interactive:
66
+ return [ " swift " ]
67
+
68
+ case . moduleWrap:
69
+ return [ " swift-modulewrap " ]
70
+ }
71
+ }
72
+
51
73
public var title : String {
52
74
switch self {
53
75
case . autolinkExtract:
You can’t perform that action at this time.
0 commit comments