chore(derive): Ensure license is recorded for subcommand

This commit is contained in:
Ed Page 2021-07-15 11:43:34 -05:00
parent 7f08773a5a
commit 53a9802ab2
5 changed files with 46 additions and 0 deletions

View file

@ -1,3 +1,16 @@
// Copyright 2018 Guillaume Pinot (@TeXitoi) <texitoi@texitoi.eu>,
// Kevin Knapp (@kbknapp) <kbknapp@gmail.com>, and
// Andrew Hobden (@hoverbear) <andrew@hoverbear.org>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//
// This work was derived from Structopt (https://github.com/TeXitoi/structopt)
// commit#ea76fa1b1b273e65e3b0b1046643715b49bec51f which is licensed under the
// MIT/Apache 2.0 license.
use crate::{
attrs::{Attrs, Kind, Name, DEFAULT_CASING, DEFAULT_ENV_CASING},
derives::args,

View file

@ -0,0 +1,9 @@
#[derive(clap::Clap)]
enum Opt {
Sub(SubCmd),
}
#[derive(clap::Clap)]
enum SubCmd {}
fn main() {}

View file

@ -0,0 +1,7 @@
error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/enum_variant_not_args.rs:3:9
|
3 | Sub(SubCmd),
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args`

View file

@ -0,0 +1,10 @@
#[derive(clap::Clap)]
struct Opt {
#[clap(flatten)]
sub: SubCmd,
}
#[derive(clap::Clap)]
enum SubCmd {}
fn main() {}

View file

@ -0,0 +1,7 @@
error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/flatten_on_subcommand.rs:3:12
|
3 | #[clap(flatten)]
| ^^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args`