mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-15 10:49:56 +02:00
Make less version check accept a path to the less binary
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
#![cfg(feature = "paging")]
|
||||
|
||||
use std::ffi::OsStr;
|
||||
use std::process::Command;
|
||||
|
||||
pub fn retrieve_less_version() -> Option<usize> {
|
||||
let cmd = Command::new("less").arg("--version").output().ok()?;
|
||||
pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<usize> {
|
||||
let cmd = Command::new(less_path).arg("--version").output().ok()?;
|
||||
parse_less_version(&cmd.stdout)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user