schema: cli: simplify can_default check
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
fe8b11eeec
commit
2fa645af2e
@ -76,10 +76,7 @@ pub(crate) fn parse_argument_list<T: AsRef<str>>(
|
|||||||
let mut can_default = false;
|
let mut can_default = false;
|
||||||
if let Some((_opt, Schema::Boolean(boolean_schema))) = schema.lookup(&name) {
|
if let Some((_opt, Schema::Boolean(boolean_schema))) = schema.lookup(&name) {
|
||||||
want_bool = true;
|
want_bool = true;
|
||||||
match boolean_schema.default {
|
can_default = matches!(boolean_schema.default, Some(false) | None);
|
||||||
Some(false) | None => can_default = true,
|
|
||||||
Some(true) => (),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut next_is_argument = false;
|
let mut next_is_argument = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user