FIX: config spec "Fixes only" mode
This commit is contained in:
		
							parent
							
								
									2d3549a200
								
							
						
					
					
						commit
						4686eff0d4
					
				
					 1 changed files with 19 additions and 20 deletions
				
			
		|  | @ -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' => { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobody
						nobody