diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-28 15:58:03 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-28 15:58:03 +0800 |
| commit | dbc811d84fd809ea606a8bbed84b3e78e8cda334 (patch) | |
| tree | 319dc4a00d0933ca19e4a94ce78a138c3bbb72f6 /mingling | |
| parent | 4e293ccccc91f89fca5857a87c03afd83e7824f3 (diff) | |
Fix bool parsing ignoring explicit `--value true` flag
Diffstat (limited to 'mingling')
| -rw-r--r-- | mingling/src/parser/picker/bools.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/mingling/src/parser/picker/bools.rs b/mingling/src/parser/picker/bools.rs index 4015cd9..80e6d5b 100644 --- a/mingling/src/parser/picker/bools.rs +++ b/mingling/src/parser/picker/bools.rs @@ -113,17 +113,12 @@ fn pick_bool( flag: mingling_core::Flag, positive: &[&str], ) -> bool { - let has_flag = args.pick_flag(flag.clone()); - if !has_flag { - let content = args.pick_argument(flag); - match content { - Some(content) => { - let s = content.as_str(); - positive.contains(&s) - } - None => false, + let content = args.pick_argument(flag); + match content { + Some(content) => { + let s = content.as_str(); + positive.contains(&s) } - } else { - true + None => false, } } |
