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

refactor: Prep for actions in derive #3789

Merged
merged 11 commits into from
Jun 4, 2022
Merged

refactor: Prep for actions in derive #3789

merged 11 commits into from
Jun 4, 2022

Conversation

epage
Copy link
Member

@epage epage commented Jun 4, 2022

No description provided.

epage added 11 commits June 4, 2022 12:58
Now that flags can have meaningful defaults and with defaults being
implicitly set for certain actions, they appear in help but don't quite
make sense.
Originally I hid all, assuming the flag-only use case but we had to
prevent that from showing up anyways.  For the takes_value case, we
should be showing something since we know what it accepts.  I decided to
only show the most basic values and hide the rest so as to not overwhelm
the user with redundant options and hope the user recognizes they are
redundant.
I thought I had broken this but it always seemed to have worked this way
Unsure why a comment said this doesn't matter.  It matters both for
counting arguments and for reporting the correct argument is exclusive.
@epage epage merged commit 44e1095 into clap-rs:master Jun 4, 2022
@epage epage deleted the refactor branch June 4, 2022 18:46
epage added a commit to epage/clap that referenced this pull request Jun 6, 2022
This is the derive support for clap-rs#3774 (see also clap-rs#3775, clap-rs#3777)

This combined with `value_parser` replaces `parser`.  The main
frustration with this is that `ArgAction::Count` (the replacement for
`parse(from_occurrences)` must be a `u64`.  We could come up with a
magic attribute that is meant to be the value parser's parsed type.  We
could then use `TryFrom` to convert the parsed type to the user's type
to allow more.  That is an exercise for the future.  Alternatively, we
have clap-rs#3792.

Prep for this included
- clap-rs#3782
- clap-rs#3783
- clap-rs#3786
- clap-rs#3789
- clap-rs#3793
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.

1 participant