this repo has no description

feat: no_header

+19 -13
+1 -1
Cargo.lock
··· 337 337 338 338 [[package]] 339 339 name = "lix-diff" 340 - version = "1.2.0" 340 + version = "1.3.0" 341 341 dependencies = [ 342 342 "clap", 343 343 "color-eyre",
+1 -1
Cargo.toml
··· 1 1 [package] 2 2 name = "lix-diff" 3 - version = "1.2.0" 3 + version = "1.3.0" 4 4 license = "MIT" 5 5 description = "A lix plugin for diffing two generations" 6 6 homepage = "https://github.com/tgirlcloud/lix-diff"
+17 -11
src/main.rs
··· 35 35 /// disable colored output (also respects NO_COLOR env var and CI environments) 36 36 #[arg(long)] 37 37 no_color: bool, 38 + 39 + /// disable the header showing the generation paths 40 + #[arg(long)] 41 + no_header: bool, 38 42 } 39 43 40 44 fn main() -> Result<()> { ··· 74 78 let before_text = format!("<<< {}", before.display()); 75 79 let after_text = format!(">>> {}", after.display()); 76 80 77 - if color::color_enabled() { 78 - let text_color = if luma().is_ok_and(|luma| luma > 0.6) { 79 - Color::DarkGray 81 + if !args.no_header { 82 + if color::color_enabled() { 83 + let text_color = if luma().is_ok_and(|luma| luma > 0.6) { 84 + Color::DarkGray 85 + } else { 86 + Color::LightGray 87 + }; 88 + let arrow_style = Style::new().bold().fg(text_color); 89 + println!("{}", arrow_style.paint(&before_text)); 90 + println!("{}\n", arrow_style.paint(&after_text)); 80 91 } else { 81 - Color::LightGray 82 - }; 83 - let arrow_style = Style::new().bold().fg(text_color); 84 - println!("{}", arrow_style.paint(&before_text)); 85 - println!("{}\n", arrow_style.paint(&after_text)); 86 - } else { 87 - println!("{before_text}"); 88 - println!("{after_text}\n"); 92 + println!("{before_text}"); 93 + println!("{after_text}\n"); 94 + } 89 95 } 90 96 91 97 println!("{packages}");