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

Support custom assets (themes) when displaying help output

This commit is contained in:
Keith Hall
2025-12-10 22:22:23 +02:00
parent 79fe5fea63
commit b7dd88eafd
2 changed files with 5 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
## Bugfixes ## Bugfixes
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall) - `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
- `--help` now correctly honors custom themes. See #3524 (@keith-hall)
## Other ## Other

View File

@@ -112,6 +112,7 @@ impl App {
let pager = matches.get_one::<String>("pager").map(|s| s.as_str()); 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);
let use_custom_assets = !matches.get_flag("no-custom-assets");
Self::display_help( Self::display_help(
interactive_output, interactive_output,
@@ -120,6 +121,7 @@ impl App {
use_color, use_color,
pager, pager,
theme_options, theme_options,
use_custom_assets,
)?; )?;
std::process::exit(0); std::process::exit(0);
} }
@@ -138,6 +140,7 @@ impl App {
use_color: bool, use_color: bool,
pager: Option<&str>, pager: Option<&str>,
theme_options: ThemeOptions, theme_options: ThemeOptions,
use_custom_assets: bool,
) -> Result<()> { ) -> Result<()> {
use crate::assets::assets_from_cache_or_binary; use crate::assets::assets_from_cache_or_binary;
use crate::directories::PROJECT_DIRS; use crate::directories::PROJECT_DIRS;
@@ -176,7 +179,7 @@ impl App {
}; };
let cache_dir = PROJECT_DIRS.cache_dir(); let cache_dir = PROJECT_DIRS.cache_dir();
let assets = assets_from_cache_or_binary(false, cache_dir)?; let assets = assets_from_cache_or_binary(use_custom_assets, cache_dir)?;
Controller::new(&help_config, &assets) Controller::new(&help_config, &assets)
.run(inputs, None) .run(inputs, None)
.ok(); .ok();