FIX: config spec "Fixes only" mode

This commit is contained in:
nobody 2024-08-18 00:40:23 +02:00 committed by murmeldin
parent 2d3549a200
commit 4686eff0d4

View file

@ -231,27 +231,26 @@ pub fn interactive_check(spec: &CfgSpec, config: KV) -> Result<(), Box<dyn Error
let mut all_valid: bool = true;
for group in spec.groups {
group_header(group.name, group.description);
let todo = needs_info(&config, group);
// TODO: add distinction between edit all / edit necessary only
let choices = if !todo.is_empty() {
println!(
"{}",
style::notice(&format!(
"The following fields need adjustment: {}",
todo.join(", ")
))
);
&["[F]ixes only", "[E]dit all", "[L]ist all", "[S]kip group"][..]
} else {
println!(
"{}",
style::notice(
"This group looks fine. OK to [S]kip, unless you want to adjust values here."
)
);
&["[S]kip group", "[E]dit all", "[L]ist all"][..]
};
loop {
let todo = needs_info(&config, group);
let choices = if !todo.is_empty() {
println!(
"{}",
style::notice(&format!(
"The following fields need adjustment: {}",
todo.join(", ")
))
);
&["[F]ixes only", "[E]dit all", "[L]ist all", "[S]kip group"][..]
} else {
println!(
"{}",
style::notice(
"This group looks fine. OK to [S]kip, unless you want to adjust values here."
)
);
&["[S]kip group", "[E]dit all", "[L]ist all"][..]
};
let choice = prompt_action(choices);
match choice {
'L' => {