on master help sign in
Use resolved path for --diagnostic as well
commit3fa09dbe2e1755740eda1de0900853c4a6ee5f3a authorDavid Peter <mail@david-peter.de> dateMon 12 Jul 2021, 22:03 (5 years ago) parentbf2b2df
1 file changed+14−4
src/bin/bat/main.rs+14−4
src/bin/bat/main.rs+14−4
@@ -231,7 +231,7 @@ fn run() -> Result<bool> {
231231 let pager = bat::config::get_pager_executable(app.matches.value_of("pager"))
232232 .unwrap_or_else(|| "less".to_owned()); // FIXME: Avoid non-canonical path to "less".
233233
234− bugreport!()
234+ let report = bugreport!()
235235 .info(SoftwareVersion::default())
236236 .info(OperatingSystem::default())
237237 .info(CommandLine::default())
@@ -253,9 +253,19 @@ fn run() -> Result<bool> {
253253 "MANPAGER",
254254 ]))
255255 .info(FileContent::new("Config file", config_file()))
256− .info(CompileTimeInformation::default())
257− .info(CommandOutput::new("Less version", pager, &["--version"]))
258− .print::<Markdown>();
256+ .info(CompileTimeInformation::default());
257+
258+ let mut report = if let Ok(resolved_path) = grep_cli::resolve_binary(pager) {
259+ report.info(CommandOutput::new(
260+ "Less version",
261+ resolved_path,
262+ &["--version"],
263+ ))
264+ } else {
265+ report
266+ };
267+
268+ report.print::<Markdown>();
259269
260270 return Ok(true);
261271 }