diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-15 02:41:14 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-15 02:41:14 +0800 |
| commit | d3ac40a44c5dec3f56393876c669ce7e0819a69e (patch) | |
| tree | 1005b936500bc4bc1146c52d9cb3da14a5cdf6e9 /mingling_picker_macros | |
| parent | fdd26053228593162fd5c41df9cfbc45d0c731b9 (diff) | |
feat(picker): add `mingling_support` feature and `is_flag` field
Rename the `core` feature to `mingling_support` in `mingling_picker` and
propagate it through `mingling_picker_macros`. Add the `is_flag` field
to `PickerTag` to indicate participation in parsing after a `--`
separator. Remove empty `seek.rs` file.
Diffstat (limited to 'mingling_picker_macros')
| -rw-r--r-- | mingling_picker_macros/Cargo.toml | 3 | ||||
| -rw-r--r-- | mingling_picker_macros/src/flag.rs | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/mingling_picker_macros/Cargo.toml b/mingling_picker_macros/Cargo.toml index 5bab6e5..58488ea 100644 --- a/mingling_picker_macros/Cargo.toml +++ b/mingling_picker_macros/Cargo.toml @@ -11,6 +11,9 @@ description = "Mingling's lightweight argument parser macros" [lib] proc-macro = true +[features] +mingling_support = [] + [dependencies] syn.workspace = true quote.workspace = true diff --git a/mingling_picker_macros/src/flag.rs b/mingling_picker_macros/src/flag.rs index 0d65382..71302ae 100644 --- a/mingling_picker_macros/src/flag.rs +++ b/mingling_picker_macros/src/flag.rs @@ -69,7 +69,12 @@ pub(crate) fn flag(input: TokenStream) -> TokenStream { }) .unwrap_or(TS2::new()); + #[cfg(feature = "mingling_support")] let import = quote! { ::mingling::picker::PickerFlag }; + + #[cfg(not(feature = "mingling_support"))] + let import = quote! { ::mingling_picker::PickerFlag }; + if ty.is_some() { quote! { #import::<#ty_ts> } } else { |
