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:
committed by
Academician
parent
929669728c
commit
a470cebf32
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user