-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AsyncParsableCommand never runs. Only shows help text. #662
Comments
Same with Swift 5.10. Using |
Have you tried removing |
Yea. Same result unfortunately. |
My code structured like the following works when running import ArgumentParser
@main
struct Command: AsyncParsableCommand {
static let configuration = CommandConfiguration(
abstract: "…",
subcommands: [
Sub.self
]
)
}
extension Command {
struct Sub: AsyncParsableCommand {
func run() async throws {
try await …
}
}
} |
i have the same issue, it never runs the |
ok for anyone having this problem it seems async parsable is unhappy with a package that targets a macos version below 12, so bumping the minimum platform version in Package.swift to 12+ seems to have fixed it. |
I'm using Swift 6.0, and Im trying to use adhere to to the AsyncParsableCommand protocol. However I'm noticing that no matter what, my program always returns the help text instead of actually running.
There's post here describing this issue as well. Seems like the compiler favors the sync run command over the async run command.
Here's my main file. Just trying to print a string right now.
ArgumentParser version:
main
branchSwift version:
swift-driver version: 1.113 Apple Swift version 6.0 (swiftlang-6.0.0.7.6 clang-1600.0.24.1) Target: arm64-apple-macosx14.0
.Checklist
main
branch of this packageSteps to Reproduce
mkdir MyCLI && cd MyCLI
swift package init --name MyCLI --type executable
Package.swift
Sources/main.swift
toSources/MyCLI.swift
Expected behavior
I'd expect when running
swift run MyCLI
that i would see "I'm working!" in the terminal.Actual behavior
Right now this always displays the help text.
The text was updated successfully, but these errors were encountered: