From 41ac113f13713178f0c6cdbcc936f4db419e0a45 Mon Sep 17 00:00:00 2001 From: Link Dupont Date: Tue, 25 Aug 2026 22:49:18 -0400 Subject: [PATCH] fix: make Main the root command instead of a passthrough wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @main Application was itself an AsyncParsableCommand that captured every argument via .captureForPassthrough and forwarded them to Main.main(args), so running container-compose went through two nested ArgumentParser layers. The outer parser saw all flags first, so --help/-h surfaced the anonymous wrapper's usage instead of the help configured on Main (command name, abstract, version, subcommands). This commit removes the wrapper: Application is now a plain struct whose static main() calls await Main.main(), making Main — which already declares the container-compose configuration — the single root ArgumentParser command. --- Sources/ContainerComposeApp/application.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Sources/ContainerComposeApp/application.swift b/Sources/ContainerComposeApp/application.swift index c6bdb74c..9fc9eb6f 100644 --- a/Sources/ContainerComposeApp/application.swift +++ b/Sources/ContainerComposeApp/application.swift @@ -6,13 +6,10 @@ // import ContainerComposeCore -import ArgumentParser @main -struct Application: AsyncParsableCommand { - @Argument(parsing: .captureForPassthrough) var args: [String] - - func run() async throws { - await Main.main(args) +struct Application { + static func main() async { + await Main.main() } }