Skip to content

Commit 8525dfe

Browse files
committed
Don't print an additional error message when exiting
1 parent 7e16beb commit 8525dfe

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let package = Package(
2626
.revision("swift-DEVELOPMENT-SNAPSHOT-2020-01-29-a")
2727
),
2828
.package(url: "https://github.com/apple/swift-tools-support-core.git", from: "0.0.1"),
29-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.1")),
29+
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.2")),
3030
],
3131
targets: [
3232
.target(

Sources/swift-format/main.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import SwiftFormatConfiguration
1616
import SwiftFormatCore
1717
import SwiftSyntax
1818
import TSCBasic
19+
import ArgumentParser
1920

2021
extension SwiftFormatCommand {
2122
func run() throws {
@@ -58,10 +59,10 @@ extension SwiftFormatCommand {
5859
try dumpDefaultConfiguration()
5960
}
6061

61-
// If any of the operations have generated diagnostics, throw an error
62-
// to exit with the error status code.
62+
// If any of the operations have generated diagnostics, exit with the
63+
// error status code.
6364
if !diagnosticEngine.diagnostics.isEmpty {
64-
throw FormatError.exitWithDiagnosticErrors
65+
throw ExitCode.failure
6566
}
6667
}
6768
}

0 commit comments

Comments
 (0)