mirror of
https://github.com/sharkdp/bat
synced 2026-08-08 19:41:45 +00:00
Make less version check accept a path to the less binary
This commit is contained in:
+3
-2
@@ -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