mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
Throws an error when bat is being user as pager.
As mentioned on #1334 `bat` should not be used as a value for `pager`, this change checks both the balue of `bat` provided as a parameter or as an environment variable.
This commit is contained in:
1 parent
072fb380d8
commit
9837948c3a
3 files changed
+16
-2
No files matched your search
+2
-2
@@ -85,10 +85,10 @@ impl OutputType {
|
||||
|
||||
match pagerflags.split_first() {
|
||||
Some((pager_name, args)) => {
|
||||
let mut pager_path = PathBuf::from(pager_name);
|
||||
let pager_path = PathBuf::from(pager_name);
|
||||
|
||||
if pager_path.file_stem() == Some(&OsString::from("bat")) {
|
||||
pager_path = PathBuf::from("less");
|
||||
return Err(ErrorKind::InvalidPagerValueBat.into());
|
||||
}
|
||||
|
||||
let is_less = pager_path.file_stem() == Some(&OsString::from("less"));
|
||||
|
||||
Reference in new issue
Block a user