apple / swift-argument-parser

Straightforward, type-safe argument parsing for Swift
Apache License 2.0
3.31k stars 311 forks source link

Support passing arguments to async main #568

Closed Austinpayne closed 3 months ago

Austinpayne commented 1 year ago

Adds a new static main function to AsyncParsableCommand to allow users to manually pass in arguments. The new functions behaves identically to the version found in ParsableCommand (see: https://github.com/apple/swift-argument-parser/blob/main/Sources/ArgumentParser/Parsable%20Types/ParsableCommand.swift#L126). This functionality is useful for manually building an argument list, e.g. when building a busybox~like binary.

Checklist

natecook1000 commented 1 year ago

Thanks, @Austinpayne! This is a great addition — when I saw it I thought, "don't we have that already?"

Would you mind adding a test that verifies that this will parse and run an async command correctly? Thank you!

natecook1000 commented 4 months ago

@swift-ci Please test

natecook1000 commented 4 months ago

@swift-ci Please test

natecook1000 commented 4 months ago

@swift-ci Please test