-
Notifications
You must be signed in to change notification settings - Fork 331
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
Running Command.main() on an AsyncParseableCommand with AsyncParseableCommand sub commands will crash #688
Comments
I found a workaround. It seems that the main.swift call of |
this way the bundled app can call any of the sub commands in the future. the go() is to workaround apple/swift-argument-parser#688
this way the bundled app can call any of the sub commands in the future. the go() is to workaround apple/swift-argument-parser#688
What works for me is: @main
struct CLI {
static func main() async {
await SomeAsyncCommand.main()
}
} |
Following [this suggestion](apple/swift-argument-parser#688 (comment)), thanks!
Following [this suggestion](apple/swift-argument-parser#688 (comment)), thanks!
Awesome, thanks for your tip! |
Following [this suggestion](apple/swift-argument-parser#688 (comment)), thanks!
I have a
AsyncParseableCommand
with oneAsyncParseableCommand
sub commands. My package is built targeting macOS 15.If I run the "parent" Command with
Command.main(CommandLine.arguments)
it will fail with the message:ArgumentParser version:
1.5.0
Swift version:
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1) Target: arm64-apple-macosx15.0
Checklist
main
branch of this packageSteps to Reproduce
Open CommandIssue.zip
Set up the reproducible directory:
swift run Tool
It will crash with the above.
Remove the
SubCommand
from theCommandIssue.configuration
.swift run Tool
It will not crash.
Expected behavior
I expect that this will not report that it is not working due to building for an asynchronous command supporting platform, since it is. I expect it to print a hello world message. FWIW I also filed FB16143524.
Actual behavior
It will crash as described above.
The text was updated successfully, but these errors were encountered: