Repository: sharkdp/bat
File: src/bin/bat/main.rs (Rust)

Code before:
        .info(FileContent::new("Config file", config_file()))
        .info(CompileTimeInformation::default());

    let mut report = if let Ok(resolved_path) = grep_cli::resolve_binary(pager) {
        report.info(CommandOutput::new(
            "Less version",
            resolved_path,
            &["--version"],
        ))
    } else {
        report
    };

    report.print::<Markdown>();
}

/// Returns `Err(..)` upon fatal errors. Otherwise, returns `Ok(true)` on full success and
/// `Ok(false)` if any intermediate errors occurred (were printed).
fn run() -> Result<bool> {
    let app = App::new()?;

    if app.matches.is_present("diagnostic") {
        #[cfg(feature = "bugreport")]
        invoke_bugreport(&app);
        #[cfg(not(feature = "bugreport"))]
        println!("--diagnostic is not enabled");
        return Ok(true);
    }

    match app.matches.subcommand() {
        ("cache", Some(cache_matches)) => {
            // If there is a file named 'cache' in the current working directory,
            // arguments for subcommand 'cache' are not mandatory.
            // If there are non-zero arguments, execute the subcommand cache, else, open the file cache.
            if !cache_matches.args.is_empty() {
                run_cache_subcommand(cache_matches)?;
                Ok(true)
            } else {
                let inputs = vec![Input::ordinary_file("cache")];
                let config = app.config(&inputs)?;

                run_controller(inputs, &config)
            }
        }
        _ => {
            let inputs = app.inputs()?;
            let config = app.config(&inputs)?;

            if app.matches.is_present("list-languages") {
                let languages: String = get_languages(&config)?;
                let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];

Review comment (bug):
```suggestion
        println!("bat has been built without the 'bugreport' feature. The '--diagnostic' option is not available.");
```

Code after:
        .info(FileContent::new("Config file", config_file()))
        .info(CompileTimeInformation::default());

    let mut report = if let Ok(resolved_path) = grep_cli::resolve_binary(pager) {
        report.info(CommandOutput::new(
            "Less version",
            resolved_path,
            &["--version"],
        ))
    } else {
        report
    };

    report.print::<Markdown>();
}

/// Returns `Err(..)` upon fatal errors. Otherwise, returns `Ok(true)` on full success and
/// `Ok(false)` if any intermediate errors occurred (were printed).
fn run() -> Result<bool> {
    let app = App::new()?;

    if app.matches.is_present("diagnostic") {
        #[cfg(feature = "bugreport")]
        invoke_bugreport(&app);
        #[cfg(not(feature = "bugreport"))]
        println!("bat has been built without the 'bugreport' feature. The '--diagnostic' option is not available.");
        return Ok(true);
    }

    match app.matches.subcommand() {
        ("cache", Some(cache_matches)) => {
            // If there is a file named 'cache' in the current working directory,
            // arguments for subcommand 'cache' are not mandatory.
            // If there are non-zero arguments, execute the subcommand cache, else, open the file cache.
            if !cache_matches.args.is_empty() {
                run_cache_subcommand(cache_matches)?;
                Ok(true)
            } else {
                let inputs = vec![Input::ordinary_file("cache")];
                let config = app.config(&inputs)?;

                run_controller(inputs, &config)
            }
        }
        _ => {
            let inputs = app.inputs()?;
            let config = app.config(&inputs)?;

            if app.matches.is_present("list-languages") {
                let languages: String = get_languages(&config)?;
                let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];