mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-10-31 15:12:12 +00:00 
			
		
		
		
	BAT_STYLE accounts for multiple styles (ie numbers,header)
This commit is contained in:
		
							
								
								
									
										22
									
								
								src/app.rs
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								src/app.rs
									
									
									
									
									
								
							| @@ -439,17 +439,17 @@ impl App { | |||||||
|                         acc |                         acc | ||||||
|                     }) |                     }) | ||||||
|             } else { |             } else { | ||||||
|                 let style = env::var("BAT_STYLE").unwrap_or(String::from(BAT_STYLE_DEFAULT)); |                 let style_str = env::var("BAT_STYLE").unwrap_or(String::from(BAT_STYLE_DEFAULT)); | ||||||
|                 match OutputComponent::from_str(&style) { |                 style_str | ||||||
|                     Ok(s) => [s] |                     .split(",") | ||||||
|                         .iter() |                     .map(|x| OutputComponent::from_str(&x)) | ||||||
|                         .map(|style| style.components(self.interactive_output)) |                     .map(|s| match s { | ||||||
|                         .fold(HashSet::new(), |mut acc, components| { |                         Ok(style) => style.components(self.interactive_output), | ||||||
|                             acc.extend(components.iter().cloned()); |                         Err(_) => &[], | ||||||
|                             acc |                     }).fold(HashSet::new(), |mut acc, components| { | ||||||
|                         }), |                         acc.extend(components.iter().cloned()); | ||||||
|                     Err(_) => HashSet::new(), |                         acc | ||||||
|                 } |                     }) | ||||||
|             }, |             }, | ||||||
|         )) |         )) | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user