This commit is contained in:
FroVolod
2022-02-16 10:29:08 +02:00
parent cab24fba62
commit de01720209
5 changed files with 5 additions and 5 deletions
@@ -123,7 +123,7 @@ pub fn fn_choose_variant(ast: &syn::DeriveInput, variants: &syn::punctuated::Pun
};
};
};
let input_context = interactive_clap_attrs_context.get_inpun_context_dir();
let input_context = interactive_clap_attrs_context.get_input_context_dir();
quote! {
pub fn choose_variant(context: #input_context) -> color_eyre::eyre::Result<Self> {
@@ -47,7 +47,7 @@ pub fn from_cli_for_enum(ast: &syn::DeriveInput, variants: &syn::punctuated::Pun
});
let input_context_dir = interactive_clap_attrs_context.clone().get_inpun_context_dir();
let input_context_dir = interactive_clap_attrs_context.clone().get_input_context_dir();
quote! {
pub fn from_cli(
@@ -54,7 +54,7 @@ pub fn from_cli_for_struct(ast: &syn::DeriveInput, fields: &syn::Fields) -> proc
struct_field(field, &fields_without_subcommand)
});
let input_context_dir = interactive_clap_attrs_context.get_inpun_context_dir();
let input_context_dir = interactive_clap_attrs_context.get_input_context_dir();
let interactive_clap_context_scope_for_struct = syn::Ident::new(&format!("InteractiveClapContextScopeFor{}", &name), Span::call_site());
let new_context_scope = quote! {
@@ -31,7 +31,7 @@ pub fn from_cli_arg(ast: &syn::DeriveInput, fields: &syn::Fields) -> Vec<proc_ma
if fields_without_subcommand_to_string.contains(&ident_field.to_string()) & !fields_with_skip_default_from_cli_to_string.contains(&ident_field.to_string()) {
let fn_from_cli_arg = syn::Ident::new(&format!("from_cli_{}", &ident_field), Span::call_site());
let optional_cli_field_name = syn::Ident::new(&format!("optional_cli_{}", ident_field), Span::call_site());
let input_context_dir = interactive_clap_attrs_context.clone().get_inpun_context_dir();
let input_context_dir = interactive_clap_attrs_context.clone().get_input_context_dir();
let cli_field_type = super::cli_field_type::cli_field_type(ty);
let fn_input_arg = syn::Ident::new(&format!("input_{}", &ident_field), Span::call_site());
quote! {
@@ -74,7 +74,7 @@ impl InteractiveClapAttrsContext {
}
}
pub fn get_inpun_context_dir(self) -> proc_macro2::TokenStream {
pub fn get_input_context_dir(self) -> proc_macro2::TokenStream {
let context_dir = match self.context_dir {
Some(context_dir) => context_dir,
None => quote! ()