diff options
Diffstat (limited to 'vendor/clap_derive/src/lib.rs')
-rw-r--r-- | vendor/clap_derive/src/lib.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/vendor/clap_derive/src/lib.rs b/vendor/clap_derive/src/lib.rs index 86b7628f6..84f2f0ded 100644 --- a/vendor/clap_derive/src/lib.rs +++ b/vendor/clap_derive/src/lib.rs @@ -22,35 +22,27 @@ use proc_macro::TokenStream; use proc_macro_error::proc_macro_error; use syn::{parse_macro_input, DeriveInput}; -mod attrs; +mod attr; mod derives; mod dummies; -mod parse; +mod item; mod utils; /// Generates the `ValueEnum` impl. -#[proc_macro_derive(ValueEnum, attributes(clap))] +#[proc_macro_derive(ValueEnum, attributes(clap, value))] #[proc_macro_error] pub fn value_enum(input: TokenStream) -> TokenStream { let input: DeriveInput = parse_macro_input!(input); derives::derive_value_enum(&input).into() } -/// Generates the `ValueEnum` impl. -#[proc_macro_derive(ArgEnum, attributes(clap))] -#[proc_macro_error] -pub fn arg_enum(input: TokenStream) -> TokenStream { - let input: DeriveInput = parse_macro_input!(input); - derives::derive_value_enum(&input).into() -} - /// Generates the `Parser` implementation. /// /// This is far less verbose than defining the `clap::Command` struct manually, /// receiving an instance of `clap::ArgMatches` from conducting parsing, and then /// implementing a conversion code to instantiate an instance of the user /// context struct. -#[proc_macro_derive(Parser, attributes(clap, structopt))] +#[proc_macro_derive(Parser, attributes(clap, structopt, command, arg, group))] #[proc_macro_error] pub fn parser(input: TokenStream) -> TokenStream { let input: DeriveInput = parse_macro_input!(input); @@ -58,7 +50,7 @@ pub fn parser(input: TokenStream) -> TokenStream { } /// Generates the `Subcommand` impl. -#[proc_macro_derive(Subcommand, attributes(clap))] +#[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); @@ -66,7 +58,7 @@ pub fn subcommand(input: TokenStream) -> TokenStream { } /// Generates the `Args` impl. -#[proc_macro_derive(Args, attributes(clap))] +#[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); |