added "arg_enum" to attrs

This commit is contained in:
FroVolod
2022-10-05 20:55:16 +03:00
parent 56ffcc743b
commit b6294f2bd0
2 changed files with 7 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ pub fn impl_interactive_clap(ast: &syn::DeriveInput) -> TokenStream {
match attr_token {
proc_macro2::TokenTree::Group(group) => {
if group.stream().to_string().contains("subcommand")
| group.stream().to_string().contains("arg_enum")
| group.stream().to_string().contains("long")
| (group.stream().to_string() == "skip".to_string())
{

View File

@@ -47,6 +47,12 @@ impl InteractiveClapAttrsCliField {
.map(|subcommand| subcommand.to_cli_args())
.unwrap_or_default();
};
} else if "arg_enum".to_string() == ident.to_string() {
args_without_attrs = quote! {
if let Some(arg) = &self.#ident_field {
args.push_front(arg.to_string())
}
};
} else if "long".to_string() == ident.to_string() {
let ident_field_to_kebab_case_string =
crate::helpers::to_kebab_case::to_kebab_case(