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: Clarify value parser #4244

Merged
merged 2 commits into from Sep 21, 2022
Merged

docs: Clarify value parser #4244

merged 2 commits into from Sep 21, 2022

Conversation

epage
Copy link
Member

@epage epage commented Sep 21, 2022

Things that tripped up a user

  • Derive reference was misunderstood to say that the only alternative to
    the built-in value parser behavior was to implement
    ValueParserFactory
    • We now delegate to value_parser!s docs any talk of integrating
      into it (it should have been a subbullet of "not present" anyways)
  • value_parser! relies too much on the example to demonstrate behavior
    when the user will likely make the determination of whether its
    relevant before then
    • We are now more upfront what type mappings are supported
  • Too many steps to find all information
    • For example, a user needs to look at TypedValueParser
      implementations, ValueParserFactory implementations, and From<T> for ValueParser implementations to understand what all can be used
    • We are now more upfront with a lot of this information at the entry
      points the user is most likely to look at

In addition, I did an audit of the docs to make sure they were updated
for us only supporting the new behavior and all of the new APIs.

See https://www.reddit.com/r/rust/comments/xjlie4/preannouncing_clap_40_a_rust_cli_argument_parser/ip9kzf1/

This was missed in the migration to the reference being on docs.rs.  Not
feeling its worth finding a way to integrate it into the new structure.
Things that tripped up a user
- Derive reference was misunderstood to say that the only alternative to
  the built-in value parser behavior was to implement
  `ValueParserFactory`
  - We now delegate to `value_parser!`s docs any talk of integrating
    into it (it should have been a subbullet of "not present" anyways)
- `value_parser!` relies too much on the example to demonstrate behavior
  when the user will likely make the determination of whether its
  relevant before then
  - We are now more upfront what type mappings are supported
- Too many steps to find all information
  - For example, a user needs to look at `TypedValueParser`
    implementations, `ValueParserFactory` implementations, and `From<T>
    for ValueParser` implementations to understand what all can be used
  - We are now more upfront with a lot of this information at the entry
    points the user is most likely to look at

In addition, I did an audit of the docs to make sure they were updated
for us only supporting the new behavior and all of the new APIs.

See https://www.reddit.com/r/rust/comments/xjlie4/preannouncing_clap_40_a_rust_cli_argument_parser/ip9kzf1/
@epage epage merged commit 32637d4 into clap-rs:master Sep 21, 2022
@epage epage deleted the docs branch September 21, 2022 16:34
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

1 participant