Fix --help --pager=builtin

Previously it still used less
This commit is contained in:
Keith Hall committed 2025-12-04 21:53:45 +02:00
1 parent 2371077352
commit 1796324531
2 files changed
+6 -6

No files matched your search

+2
View File
@@ -4,6 +4,8 @@
## Bugfixes ## Bugfixes
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
## Other ## Other
## Syntaxes ## Syntaxes
+4 -6
View File
@@ -110,7 +110,7 @@ impl App {
_ => interactive_output, // auto: use color if interactive _ => 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); let theme_options = Self::theme_options_from_matches(&matches);
Self::display_help( Self::display_help(
@@ -118,7 +118,7 @@ impl App {
help_type, help_type,
use_pager, use_pager,
use_color, use_color,
custom_pager, pager,
theme_options, theme_options,
)?; )?;
std::process::exit(0); std::process::exit(0);
@@ -136,7 +136,7 @@ impl App {
help_type: HelpType, help_type: HelpType,
use_pager: bool, use_pager: bool,
use_color: bool, use_color: bool,
custom_pager: Option<String>, pager: Option<&str>,
theme_options: ThemeOptions, theme_options: ThemeOptions,
) -> Result<()> { ) -> Result<()> {
use crate::assets::assets_from_cache_or_binary; use crate::assets::assets_from_cache_or_binary;
@@ -164,12 +164,10 @@ impl App {
PagingMode::Never PagingMode::Never
}; };
let pager = bat::config::get_pager_executable(custom_pager.as_deref());
let help_config = Config { let help_config = Config {
style_components: StyleComponents::new(StyleComponent::Plain.components(false)), style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
paging_mode, paging_mode,
pager: pager.as_deref(), pager,
colored_output: use_color, colored_output: use_color,
true_color: use_color, true_color: use_color,
language: if use_color { Some("help") } else { None }, language: if use_color { Some("help") } else { None },