Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--theme: return a list of all themes if the theme argument doesn't match #3009

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- Update the Lisp syntax, see #2970 (@ccqpein)
- Use bat's ANSI iterator during tab expansion, see #2998 (@eth-p)
- Support 'statically linked binary' for aarch64 in 'Release' page, see #2992 (@tzq0301)
- `--theme` now provides a short list of all themes if the given theme does not exist, see #3009 (@monkeydom)

## Syntaxes

Expand Down
7 changes: 6 additions & 1 deletion src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ impl HighlightingAssets {
return self.get_theme("ansi");
}
if !theme.is_empty() {
bat_warning!("Unknown theme '{}', using default.", theme)
let all_themes: Vec<&str> = self.get_theme_set().themes().collect();
bat_warning!(
"Unknown theme '{}', using default. (Available themes: {})",
theme,
all_themes.join(", ")
);
}
self.get_theme_set()
.get(self.fallback_theme.unwrap_or_else(Self::default_theme))
Expand Down