From 9cdb7087f25fd2ea1ac286dc08fe4cd944491d18 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Sat, 17 Dec 2022 11:57:17 -0500 Subject: [PATCH] Fixed --help (#361) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed --help Apparently `--help` works via exceptions 🤷‍♂️ Fixes #360 * lint issue --- Sources/tart/Root.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/tart/Root.swift b/Sources/tart/Root.swift index 1df18bb..c7ee3e9 100644 --- a/Sources/tart/Root.swift +++ b/Sources/tart/Root.swift @@ -96,6 +96,10 @@ struct Root: AsyncParsableCommand { try command.run() } } catch { + if exitCode(for: error).rawValue == 0 { + exit(withError: error) + } + // Capture the error into Sentry SentrySDK.capture(error: error) SentrySDK.flush(timeout: 2.seconds.timeInterval)