Skip to content

Support passing arguments to async main #568

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

Merged
merged 4 commits into from
May 17, 2024
Merged

Support passing arguments to async main #568

merged 4 commits into from
May 17, 2024

Conversation

Austinpayne
Copy link
Contributor

@Austinpayne Austinpayne commented Apr 26, 2023

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

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

@natecook1000
Copy link
Member

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
Copy link
Member

@swift-ci Please test

@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000 natecook1000 merged commit 29b3d39 into apple:main May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants