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

[Feature request]: Print names of all examples when --examples is missing a value. #6145

Closed
richard-uk1 opened this issue Oct 6, 2018 · 3 comments

Comments

@richard-uk1
Copy link
Contributor

If you do cargo run --example, you will get an error saying that a value was expected, but none was supplied.

It would be great if you also got a list of the available examples.

I'm not sure if clap currently supports this functionality, either

  1. Custom error path when an option with name example is missing a value.
  2. Ability to specify that a value is optional, and then manually call the clap error handler with the extra info.
@richard-uk1
Copy link
Contributor Author

I thought this may just not be possible because of the ambiguous situation cargo run --example --test, but I see that clap already rejects this, requiring it to be written as cargo run --example=--test.

@ehuss
Copy link
Contributor

ehuss commented Oct 6, 2018

Thanks for the report. This is a duplicate of #2548, so closing in favor of that.

@ehuss ehuss closed this as completed Oct 6, 2018
@richard-uk1
Copy link
Contributor Author

Yep, thought I'd checked for dupes sorry!

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