mirror of
https://github.com/sharkdp/bat.git
synced 2026-02-08 00:32:08 +00:00
Fix --help --pager=builtin
Previously it still used less
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
|
||||
|
||||
## Other
|
||||
|
||||
## Syntaxes
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user