FIX: config spec "Fixes only" mode
This commit is contained in:
parent
2d3549a200
commit
4686eff0d4
|
@ -231,27 +231,26 @@ pub fn interactive_check(spec: &CfgSpec, config: KV) -> Result<(), Box<dyn Error
|
||||||
let mut all_valid: bool = true;
|
let mut all_valid: bool = true;
|
||||||
for group in spec.groups {
|
for group in spec.groups {
|
||||||
group_header(group.name, group.description);
|
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 {
|
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);
|
let choice = prompt_action(choices);
|
||||||
match choice {
|
match choice {
|
||||||
'L' => {
|
'L' => {
|
||||||
|
|
Loading…
Reference in a new issue