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

docs(derive): Add a few notes to default_value #4905

Closed

Conversation

nicholasbishop
Copy link
Contributor

  • Clarify that the value is parsed as if it had been passed via command line, not as Rust code like some other libraries (e.g. argh).

  • Add an example for u32, but note that default_value_t is better for that type.

  • Mention that this attribute is a good way to set the default value for String args. This should help avoid confusion with trying to use default_value_t for that purpose (see How to stop warnings about parentheses required by clap macros? #4676 for example)

* Clarify that the value is parsed as if it had been passed via command
  line, not as Rust code like some other libraries (e.g. `argh`).

* Add an example for `u32`, but note that `default_value_t` is better
  for that type.

* Mention that this attribute is a good way to set the default value for
  `String` args. This should help avoid confusion with trying to use
  `default_value_t` for that purpose (see
  clap-rs#4676 for example)
@epage
Copy link
Member

epage commented May 18, 2023

This is reading more as general default_value documentation that we generally defer to the builder documentation. #4090 is about that relationship, even if this one is actually included due to defaulting.

I'd be inclined to close this.

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

2 participants