-
Notifications
You must be signed in to change notification settings - Fork 312
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
Add support for async/await where available #326
Comments
|
Today I refactored my App Store Connect API tool with using the async branch and integrating async/await using the async branch of the argument parser was sooooo satisfying. Good job everyone 👍🏼 hope this makes it in the official release soon. It is soo soo great :) For the interested of you here are some links: https://twitter.com/Blackjacxxx/status/1411730725393555456 |
|
Curious what the roadmap is for async/await support. Hoping to see it added to the main branch; using the async branch meanwhile. |
|
Same here, eagerly waiting for async support to drop officially. |
|
Is there any news on this front? Seems like it should at least work on Monterey / Xcode 13.1... are there any blockers before pushing the async to main? |
|
Tried using the async branch in a proof of concept project. Had difficulty with objects in Run() getting deinitialized before the program was done. Not sure whether the error was on my side or intrinsic to the async branch. Either way, dropped back to the main branch and haven't seen any issues. |
|
@Jerry-Carter you could try https://github.com/Blackjacx/swift-argument-parser. It works for me quite well in my CLI application. |
|
@natecook1000 @main enum Main: AsyncMain { ugliness. You might want to conditionally compile a definition of 'run() async' for Swift 5.5 vs. a synchronous definition for previous versions. |
|
@sergiocampama Does your code work with latests Xcode etc? I just keep getting: |
|
Ah, of course. Thank you! 🙏🏻 |
|
Any news from the team on this? No "official" support for async/await here is the only thing preventing us from migrating our CLI-Tools. I'm aware of the Personally, I find the extra type conforming to |
|
@natecook1000 thank you! |
|
Today I refactored my App Store Connect API tool with using the async branch and integrating async/await using the async branch of the argument parser was sooooo satisfying. Good job everyone 👍🏼 hope this makes it in the official release soon. It is soo soo great :) For the interested of you here are some links: twitter.com/Blackjacxxx/status/1411730725393555456 |
async/await is useful for writing clean and concise code for building small CLI tools, especially ones that interact with the network or the file system.
Since
@mainnow supports an async variant, I was able to add such support to a prototype with the following code:Having this be officially supported by swift-argument-parser would be ideal.
The text was updated successfully, but these errors were encountered: