Skip to content

Commit

Permalink
Rename poorly-named variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Nov 13, 2024
1 parent 1fb6f99 commit 1dd35d6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/utils/bat/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,16 @@ impl OutputType {
replace_arguments_to_less = false;
}

let pager = pager_from_config
.or(pager_from_env)
.unwrap_or_else(|| String::from("less"));

let pagerflags = shell_words::split(&pager).context("Could not parse pager command.")?;
let pager_cmd = shell_words::split(
&pager_from_config
.or(pager_from_env)
.unwrap_or_else(|| String::from("less")),
)
.context("Could not parse pager command.")?;

Ok(match pagerflags.split_first() {
Some((pager_name, args)) => {
let pager_path = PathBuf::from(pager_name);
Ok(match pager_cmd.split_first() {
Some((pager_path, args)) => {
let pager_path = PathBuf::from(pager_path);

let is_less = pager_path.file_stem() == Some(&OsString::from("less"));

Expand Down

0 comments on commit 1dd35d6

Please sign in to comment.