This reverts commits 24cb8b1..d0abb37 from clap-rs/clap#1840
This is part of #16. clap-rs/clap#1840 wasn't the right call but we
don't have time to make the decision now, so instead of having one
option and changing it in 4.0, this reverts back to clap2 behavior.
This feature is too immature at this stage in the release. See
clap-rs/clap Issue 3020 when bringing this feature back.
This reverts commit 301c6f765a.
This reverts commit 43a4c90c86.
This reverts commit 4e29777b21.
This reverts commit 69957c4ddd.
This reverts commit bdb1d324a5.
This reverts commit b102da0cd2.
This reverts commit 72429be14e.
This reverts commit 0b7def675b.
This reverts commit b86aa631be.
This reverts commit 6b458c602d.
Not seeing what this example adds over the other ones. We've already
shown subcommands and shown that `App` has extra behavior for when
definint subcommands.
This better models what users should be doing and makes it so all
comments are more clear. In a prior commit, when a changed an `exit` to
`unwrap`, I disliked the fact that I was mixing an unwrap explanatory
comment in with another comment. This makes them stand apart.
The subcommand examples focus on the various ways of looking up
subcommands except for the main one people should be using. This has
previously caused confusion, see https://github.com/clap-rs/clap/discussions/3000
To keep the examples focused, I only show `ArgMatches::subcommand`. I
figure the examples are not exhaustive and that for the cases when
someone wants to do something more specialized, they can pull up the
API reference.
The comments in these examples say that a `conflicts_with` should
override `required`. This seems to be true one way but not the other,
causing these examples to error out at runtime.
This consolidates two `crate_*!` macro examples into a `app_from_crate`
example.
- This is more of what we expect users to use
- We've talked about splitting the `crate_*` macros out into their own
crate. This shifts the focus to what clap would be providing long
term
Looks like this is coming from `update_from_arg_matches` where we do a
ladder of `if __clap_arg_matches.is_present(...)` that clippy wants to
be `else if`s. While for human edited code, that does clarify intent,
for machine generated code that is rarely read, its a pain to do, so
silencing it.
Unfortunately, it isn't in a group we can overall silence.
Fixes#3017