Make less version check accept a path to the less binary

This commit is contained in:
Ethan P authored and David Peter committed 2021-02-16 09:11:27 +01:00
1 parent 573f34d757
commit 025c5c061b
2 files changed
+5 -4

No files matched your search

+3 -2
View File
@@ -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)
}