mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
feat(derive): Reserve 'group' attribute
This commit is contained in:
parent
79321f25e4
commit
3bfa9d5ff0
2 changed files with 7 additions and 2 deletions
|
@ -34,6 +34,11 @@ impl ClapAttr {
|
|||
Some(Sp::new(AttrKind::StructOpt, attr.path.span()))
|
||||
} else if attr.path.is_ident("command") {
|
||||
Some(Sp::new(AttrKind::Command, attr.path.span()))
|
||||
} else if attr.path.is_ident("group") {
|
||||
abort!(
|
||||
attr.path.span(),
|
||||
"`#[group()]` attributes are not supported yet"
|
||||
)
|
||||
} else if attr.path.is_ident("arg") {
|
||||
Some(Sp::new(AttrKind::Arg, attr.path.span()))
|
||||
} else if attr.path.is_ident("value") {
|
||||
|
|
|
@ -50,7 +50,7 @@ pub fn parser(input: TokenStream) -> TokenStream {
|
|||
}
|
||||
|
||||
/// Generates the `Subcommand` impl.
|
||||
#[proc_macro_derive(Subcommand, attributes(clap, command, arg))]
|
||||
#[proc_macro_derive(Subcommand, attributes(clap, command, arg, group))]
|
||||
#[proc_macro_error]
|
||||
pub fn subcommand(input: TokenStream) -> TokenStream {
|
||||
let input: DeriveInput = parse_macro_input!(input);
|
||||
|
@ -58,7 +58,7 @@ pub fn subcommand(input: TokenStream) -> TokenStream {
|
|||
}
|
||||
|
||||
/// Generates the `Args` impl.
|
||||
#[proc_macro_derive(Args, attributes(clap, command, arg))]
|
||||
#[proc_macro_derive(Args, attributes(clap, command, arg, group))]
|
||||
#[proc_macro_error]
|
||||
pub fn args(input: TokenStream) -> TokenStream {
|
||||
let input: DeriveInput = parse_macro_input!(input);
|
||||
|
|
Loading…
Reference in a new issue