diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-16 01:13:09 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-16 01:13:09 +0800 |
| commit | 3acf9cbdf292bf7724a9d208b887dc8dabf3e689 (patch) | |
| tree | e9c41e63ef369ed7c522cfedebca4e4fcd0a88e8 /mingling_picker/src/builtin/pick_bool.rs | |
| parent | 9231c1de40f6f66d59ab86bea113ac3ac323c62d (diff) | |
feat(picker): return NotFound for unmatched boolean flags
Diffstat (limited to 'mingling_picker/src/builtin/pick_bool.rs')
| -rw-r--r-- | mingling_picker/src/builtin/pick_bool.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mingling_picker/src/builtin/pick_bool.rs b/mingling_picker/src/builtin/pick_bool.rs index ad93a83..65efe47 100644 --- a/mingling_picker/src/builtin/pick_bool.rs +++ b/mingling_picker/src/builtin/pick_bool.rs @@ -10,6 +10,12 @@ impl<'a> Pickable<'a> for bool { } fn pick(raw_strs: &[&str]) -> PickerArgResult<Self> { - PickerArgResult::Parsed(!raw_strs.is_empty()) + if raw_strs.is_empty() { + // No matching flag found — signal NotFound so the fallback chain + // (default → route) gets a chance to run. + PickerArgResult::NotFound + } else { + PickerArgResult::Parsed(true) + } } } |
