1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-28 16:12:30 +01:00

Add a "builtin" pager using the Minus crate

This commit is contained in:
Daniel Waechter
2024-09-05 18:27:29 -04:00
committed by Academician
parent 929669728c
commit a470cebf32
9 changed files with 257 additions and 22 deletions

View File

@@ -32,6 +32,9 @@ pub(crate) enum PagerKind {
/// most
Most,
/// builtin
Builtin,
/// A pager we don't know about
Unknown,
}
@@ -40,6 +43,10 @@ impl PagerKind {
fn from_bin(bin: &str) -> PagerKind {
use std::path::Path;
if bin == "builtin" {
return PagerKind::Builtin;
}
// Set to `less` by default on most Linux distros.
let pager_bin = Path::new(bin).file_stem();