Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(derive)!: Compile-error on nested subcommands
Before, partial command lines would panic at runtime. Now it'll be a compile error For example: ``` pub enum Opt { Daemon(DaemonCommand), } pub enum DaemonCommand { Start, Stop, } ``` Gives: ``` error[E0277]: the trait bound `DaemonCommand: clap::Args` is not satisfied --> clap_derive/tests/subcommands.rs:297:16 | 297 | Daemon(DaemonCommand), | ^^^^^^^^^^^^^ the trait `clap::Args` is not implemented for `DaemonCommand` | = note: required by `augment_args` ``` To nest this, you currently need `enum -> struct -> enum`. A later change will make it so you can use the `subcommand` attribute within enums to cover this case. This is a part of #2005
- Loading branch information