mirror of
https://github.com/Drop-OSS/interactive-clap.git
synced 2026-01-30 20:55:25 +01:00
added "arg_enum" to attrs
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user