diff --git a/Cargo.lock b/Cargo.lock index cef1b792..e5e73c20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -738,7 +738,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hl" -version = "0.25.2" +version = "0.25.3-alpha.1" dependencies = [ "atoi", "bincode", diff --git a/Cargo.toml b/Cargo.toml index f0e6e41d..f0895a16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ categories = ["command-line-utilities"] description = "Utility for viewing json-formatted log files." keywords = ["cli", "human", "log"] name = "hl" -version = "0.25.2" +version = "0.25.3-alpha.1" edition = "2021" build = "build.rs" diff --git a/src/output.rs b/src/output.rs index b4e81b8b..b1640816 100644 --- a/src/output.rs +++ b/src/output.rs @@ -20,9 +20,16 @@ pub struct Pager { impl Pager { pub fn new() -> Result { - let pager = match env::var("PAGER") { - Ok(pager) => pager, - _ => "less".into(), + let mut pager = "less".to_owned(); + + if let Ok(p) = env::var("HL_PAGER") { + if !p.is_empty() { + pager = p; + } + } else if let Ok(p) = env::var("PAGER") { + if !p.is_empty() { + pager = p; + } }; let pager = shellwords::split(&pager).unwrap_or(vec![pager]);