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

AsyncParsableCommand documentation #561

Open
robertmryan opened this issue Mar 29, 2023 · 2 comments
Open

AsyncParsableCommand documentation #561

robertmryan opened this issue Mar 29, 2023 · 2 comments

Comments

@robertmryan
Copy link
Contributor

robertmryan commented Mar 29, 2023

Right now, if you supply an async rendition of run() in conjunction with ParsableCommand, it produces no warning or error, but whenever you run the app, you simply see the “USAGE” text. It took a surprising/unnecessary amount of time pouring through the class library and looking at a particular code sample, before I stumbled across AsyncParsableCommand.

  • Ideally, it would be great to produce a meaningful warning/error when a valid run() is not found. It obviously fell through to a point where “USAGE” text was displayed. Is it possible to give us some warning why we got the “USAGE” text?

  • I would suggest that the README.md and the documentation introduction make some reference to AsyncParsableCommand for async renditions of run(). This should be more easily discovered.

If you would like me to take a pass at a PR to that end, please let me know.

@natecook1000
Copy link
Member

Ideally, it would be great to produce a meaningful warning/error when a valid run() is not found. It obviously fell through to a point where “USAGE” text was displayed. Is it possible to give us some warning why we got the “USAGE” text?

I don't think we can detect that this is happening. Ideally Swift would warn for this near-miss implementation, but since the ParsableCommand protocol provides the default implementation for run(), there isn't an unsatisfied requirement to complain about.

I would suggest that the README.md and the documentation introduction make some reference to AsyncParsableCommand for async renditions of run(). This should be more easily discovered.

A PR for this would be great, thank you!

robertmryan added a commit to robertmryan/swift-argument-parser that referenced this issue Apr 6, 2023
@robertmryan
Copy link
Contributor Author

@natecook1000 - I have submitted PR #565 with an attempt to make AsyncParsableCommand more easily discovered. If you have suggestions you would like me to incorporate, please let me know.

Needless to say, feel free to make whatever changes you want. My intent was simply to move the ball forward.

natecook1000 pushed a commit that referenced this issue Nov 16, 2023
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

No branches or pull requests

2 participants