1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-03 18:51:44 +00:00

Add --diagnostic option to bat

This commit is contained in:
sharkdp
2020-12-31 18:17:15 +01:00
committed by David Peter
parent 5e1f9fadf4
commit ebb97e94a9
4 changed files with 88 additions and 4 deletions
+22 -2
View File
@@ -35,8 +35,7 @@ use bat::{
error::*,
input::Input,
style::{StyleComponent, StyleComponents},
MappingTarget,
PagingMode,
MappingTarget, PagingMode,
};
const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
@@ -228,6 +227,27 @@ fn run_controller(inputs: Vec<Input>, config: &Config) -> Result<bool> {
fn run() -> Result<bool> {
let app = App::new()?;
if app.matches.is_present("diagnostic") {
use bugreport::{bugreport, collectors::*};
bugreport!()
.info(SoftwareVersion::default())
.info(OperatingSystem::default())
.info(CommandLine::default())
.info(EnvironmentVariables::list(&[
"SHELL",
"PAGER",
"BAT_PAGER",
"BAT_CONFIG_PATH",
"BAT_STYLE",
"BAT_THEME",
"BAT_TABS",
]))
.print_markdown();
return Ok(true);
}
match app.matches.subcommand() {
("cache", Some(cache_matches)) => {
// If there is a file named 'cache' in the current working directory,