on master help sign in
be consistent
cea05e9Taylor
src/clap_app.rs+2−2
@@ -146,10 +146,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
146 .long("highlight-line")
146 .long("highlight-line")
147 .overrides_with("highlight-line")
147 .overrides_with("highlight-line")
148 .takes_value(true)
148 .takes_value(true)
149− .value_name("n")
149+ .value_name("N")
150 .help("Highlight a line.")
150 .help("Highlight a line.")
151 .long_help(
151 .long_help(
152− "Highlight the nth line. The background color is changed to create contrast.",
152+ "Highlight the Nth line. The background color is changed to create contrast.",
153 ),
153 ),
154 )
154 )
155 .arg(
155 .arg(
src/printer.rs+4−10
@@ -302,16 +302,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
302 }
302 }
303
303
304 // Line highlighting
304 // Line highlighting
305− let background = match self.config.highlight_line {
305+ let background = self.config.highlight_line
306− Some(line) => {
307− if line_number == line {
306+ .filter(|line| *line == line_number)
308− self.background_highlight
307+ .map(|_| self.background_highlight)
309− } else {
308+ .unwrap();
310− None
311− }
312− }
313− _ => None,
314− };
315
309
316 // Line contents.
310 // Line contents.
317 if self.config.output_wrap == OutputWrap::None {
311 if self.config.output_wrap == OutputWrap::None {