mirror of
https://github.com/sharkdp/bat
synced 2026-07-25 17:21:43 +00:00
Add a --style=default option (#2119)
* Add a --style=default option * Added --style=default test and CHANGELOG entry * Format CHANGELOG.md options with quotes Co-authored-by: Martin Nordholts <enselic@gmail.com> * Update help text for '--style' * Make --style=default the default option * Update style descriptions: "basic" -> "recommended" * Add integration test for --style=default as default * Update clap long help for --style
This commit is contained in:
+1
-1
@@ -322,7 +322,7 @@ impl App {
|
||||
.collect::<Vec<_>>()
|
||||
})
|
||||
.or(env_style_components)
|
||||
.unwrap_or_else(|| vec![StyleComponent::Full])
|
||||
.unwrap_or_else(|| vec![StyleComponent::Default])
|
||||
.into_iter()
|
||||
.map(|style| style.components(self.interactive_output))
|
||||
.fold(HashSet::new(), |mut acc, components| {
|
||||
|
||||
@@ -398,6 +398,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
!&[
|
||||
"auto",
|
||||
"full",
|
||||
"default",
|
||||
"plain",
|
||||
"header",
|
||||
"header-filename",
|
||||
@@ -419,7 +420,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
})
|
||||
.help(
|
||||
"Comma-separated list of style elements to display \
|
||||
(*auto*, full, plain, changes, header, grid, rule, numbers, snip).",
|
||||
(*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).",
|
||||
)
|
||||
.long_help(
|
||||
"Configure which elements (line numbers, file headers, grid \
|
||||
@@ -430,8 +431,9 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
'--style=\"..\"' option to the configuration file or export the \
|
||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
|
||||
Possible values:\n\n \
|
||||
* full: enables all available components (default).\n \
|
||||
* auto: same as 'full', unless the output is piped.\n \
|
||||
* default: enables recommended style components (default).\n \
|
||||
* full: enables all available components.\n \
|
||||
* auto: same as 'default', unless the output is piped.\n \
|
||||
* plain: disables all available components.\n \
|
||||
* changes: show Git modification markers.\n \
|
||||
* header: alias for 'header-filename'.\n \
|
||||
|
||||
Reference in New Issue
Block a user