From 537a815efaa3fb85435ca3e500f870d448b17337 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 31 Mar 2026 08:54:51 +0800 Subject: Add Argument type to picker builtins and expose Picker - Add `#[derive(Debug, Default)]` to `Argument` struct - Add `dump_remains` method to `Argument` - Remove `#[doc(hidden)]` from `Picker` struct - Implement `Pickable` for `Argument` to allow consuming remaining args --- mingling/src/parser/picker/builtin.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mingling/src/parser/picker/builtin.rs') diff --git a/mingling/src/parser/picker/builtin.rs b/mingling/src/parser/picker/builtin.rs index 0b1ce08..9184813 100644 --- a/mingling/src/parser/picker/builtin.rs +++ b/mingling/src/parser/picker/builtin.rs @@ -1,6 +1,6 @@ use size::Size; -use crate::parser::Pickable; +use crate::parser::{Argument, Pickable}; impl Pickable for String { type Output = String; @@ -51,3 +51,14 @@ impl Pickable for usize { } } } + +impl Pickable for Argument { + type Output = Argument; + + fn pick( + args: &mut crate::parser::Argument, + _flag: mingling_core::Flag, + ) -> Option { + Some(args.dump_remains().into()) + } +} -- cgit