mirror of
https://github.com/sharkdp/bat
synced 2026-08-03 18:51:44 +00:00
add line highlight
This commit is contained in:
@@ -64,6 +64,9 @@ pub struct Config<'a> {
|
||||
|
||||
/// The syntax highlighting theme
|
||||
pub theme: String,
|
||||
|
||||
/// A line to highlight
|
||||
pub highlight_line: Option<usize>,
|
||||
}
|
||||
|
||||
fn is_truecolor_terminal() -> bool {
|
||||
@@ -182,6 +185,7 @@ impl App {
|
||||
.or_else(|| env::var("BAT_THEME").ok())
|
||||
.unwrap_or(String::from(BAT_THEME_DEFAULT)),
|
||||
line_range: transpose(self.matches.value_of("line-range").map(LineRange::from))?,
|
||||
highlight_line: self.matches.value_of("highlight-line").and_then(|w| w.parse().ok()),
|
||||
output_components,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user