Skip to content
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

Support passing arguments to async main #568

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Austinpayne
Copy link

@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

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.

None yet

3 participants