File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import struct TSCUtility.Version
19
19
/// The Swift driver.
20
20
public struct Driver {
21
21
public enum Error : Swift . Error , Equatable , DiagnosticData {
22
+ case unknownOrMissingSubcommand( String )
22
23
case invalidDriverName( String )
23
24
case invalidInput( String )
24
25
case noInputFiles
@@ -49,6 +50,8 @@ public struct Driver {
49
50
50
51
public var description : String {
51
52
switch self {
53
+ case . unknownOrMissingSubcommand( let subcommand) :
54
+ return " unknown or missing subcommand ' \( subcommand) ' "
52
55
case . invalidDriverName( let driverName) :
53
56
return " invalid driver name: \( driverName) "
54
57
case . invalidInput( let input) :
Original file line number Diff line number Diff line change 67
67
?? Process . findExecutable ( subcommand)
68
68
69
69
if subcommandPath == nil || !localFileSystem. exists ( subcommandPath!) {
70
- fatalError ( " cannot find subcommand executable ' \ ( subcommand) ' " )
70
+ throw Driver . Error . unknownOrMissingSubcommand ( subcommand)
71
71
}
72
72
73
73
// Execute the subcommand.
You can’t perform that action at this time.
0 commit comments