Commit graph

8 commits

Author SHA1 Message Date
Ed Page
51c723a84f fix(derive): Fix the problem where the build fails due to the ambiguous type of map
> This PR closes #490. Please refer to #490 for the detail of the problem. Let me know if you want to make `convert_type` a function.

This is a port of https://github.com/TeXitoi/structopt/pull/491

This is part of #2809
2021-10-06 13:22:56 -05:00
Ed Page
7f08773a5a 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
2021-07-15 11:45:13 -05:00
Pavan Kumar Sunkara
7bc282dd4e Rename with_name to new for Arg & ArgGroup 2020-05-14 22:50:56 +02:00
CreepySkeleton
ae574df2f9
Extract subcommands into separate trait 2020-02-12 23:15:05 +03:00
CreepySkeleton
596bdec856 Bugfix #324
Fixes https://github.com/TeXitoi/structopt/issues/324
2020-02-04 17:07:39 +03:00
CreepySkeleton
5aafe9eaaf Pre release tweaks and changelog 2020-02-04 11:10:47 +03:00
Pavan Kumar Sunkara
dd75cee72c fix: Clippy should pass 2020-02-01 06:48:50 +01:00
Pavan Kumar Sunkara
5e8f424dfe Merged clap_derive using git-subtree 2020-01-18 17:40:07 +05:30