1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 00:32:08 +00:00

Merge pull request #3516 from sharkdp/fix_help_builtin_pager

Fix --help --pager=builtin
This commit is contained in:
Keith Hall
2025-12-05 22:22:22 +02:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@@ -4,6 +4,8 @@
## Bugfixes
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
## Other
## Syntaxes

View File

@@ -110,7 +110,7 @@ impl App {
_ => interactive_output, // auto: use color if interactive
};
let custom_pager = matches.get_one::<String>("pager").map(|s| s.to_string());
let pager = matches.get_one::<String>("pager").map(|s| s.as_str());
let theme_options = Self::theme_options_from_matches(&matches);
Self::display_help(
@@ -118,7 +118,7 @@ impl App {
help_type,
use_pager,
use_color,
custom_pager,
pager,
theme_options,
)?;
std::process::exit(0);
@@ -136,7 +136,7 @@ impl App {
help_type: HelpType,
use_pager: bool,
use_color: bool,
custom_pager: Option<String>,
pager: Option<&str>,
theme_options: ThemeOptions,
) -> Result<()> {
use crate::assets::assets_from_cache_or_binary;
@@ -164,12 +164,10 @@ impl App {
PagingMode::Never
};
let pager = bat::config::get_pager_executable(custom_pager.as_deref());
let help_config = Config {
style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
paging_mode,
pager: pager.as_deref(),
pager,
colored_output: use_color,
true_color: use_color,
language: if use_color { Some("help") } else { None },