mirror of https://github.com/sharkdp/bat.git
Update clap/docs for merging `--style` arguments
This commit is contained in:
parent
7cce8e6bf5
commit
bbdac57426
10
README.md
10
README.md
|
@ -507,6 +507,16 @@ and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
|
||||||
variable to make these changes permanent or use `bat`s
|
variable to make these changes permanent or use `bat`s
|
||||||
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
||||||
|
|
||||||
|
>[!tip]
|
||||||
|
> If you specify a default style in `bat`'s config file, you can change which components
|
||||||
|
> are displayed during a single run of `bat` using the `--style` command-line argument.
|
||||||
|
> By prefixing a component with `+` or `-`, it can be added or removed from the current style.
|
||||||
|
>
|
||||||
|
> For example, if your config contains `--style=full,-snip`, you can run bat with
|
||||||
|
> `--style=-grid,+snip` to remove the grid and add back the `snip` component.
|
||||||
|
> Or, if you want to override the styles completely, you use `--style=numbers` to
|
||||||
|
> only show the line numbers.
|
||||||
|
|
||||||
### Adding new syntaxes / language definitions
|
### Adding new syntaxes / language definitions
|
||||||
|
|
||||||
Should you find that a particular syntax is not available within `bat`, you can follow these
|
Should you find that a particular syntax is not available within `bat`, you can follow these
|
||||||
|
|
|
@ -125,9 +125,16 @@ Options:
|
||||||
--style <components>
|
--style <components>
|
||||||
Configure which elements (line numbers, file headers, grid borders, Git modifications, ..)
|
Configure which elements (line numbers, file headers, grid borders, Git modifications, ..)
|
||||||
to display in addition to the file contents. The argument is a comma-separated list of
|
to display in addition to the file contents. The argument is a comma-separated list of
|
||||||
components to display (e.g. 'numbers,changes,grid') or a pre-defined style ('full'). To
|
components to display (e.g. 'numbers,changes,grid') or a pre-defined style ('full').
|
||||||
set a default style, add the '--style=".."' option to the configuration file or export the
|
|
||||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE="..").
|
To set a default style, add the '--style=".."' option to the configuration file or export
|
||||||
|
the BAT_STYLE environment variable (e.g.: export BAT_STYLE="..").
|
||||||
|
|
||||||
|
When styles are specified in multiple places, the "nearest" set of styles take precedence.
|
||||||
|
The command-line arguments are the highest priority, followed by the BAT_STYLE environment
|
||||||
|
variable, and then the configuration file. If any set of styles consists entirely of
|
||||||
|
components prefixed with "+" or "-", it will modify the previous set of styles instead of
|
||||||
|
replacing them.
|
||||||
|
|
||||||
By default, the following components are enabled:
|
By default, the following components are enabled:
|
||||||
changes, grid, header-filename, numbers, snip
|
changes, grid, header-filename, numbers, snip
|
||||||
|
|
|
@ -425,9 +425,16 @@ pub fn build_app(interactive_output: bool) -> Command {
|
||||||
borders, Git modifications, ..) to display in addition to the \
|
borders, Git modifications, ..) to display in addition to the \
|
||||||
file contents. The argument is a comma-separated list of \
|
file contents. The argument is a comma-separated list of \
|
||||||
components to display (e.g. 'numbers,changes,grid') or a \
|
components to display (e.g. 'numbers,changes,grid') or a \
|
||||||
pre-defined style ('full'). To set a default style, add the \
|
pre-defined style ('full').\n\n\
|
||||||
'--style=\"..\"' option to the configuration file or export the \
|
To set a default style, add the '--style=\"..\"' option to the \
|
||||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
|
configuration file or export the BAT_STYLE environment variable \
|
||||||
|
(e.g.: export BAT_STYLE=\"..\").\n\n\
|
||||||
|
When styles are specified in multiple places, the \"nearest\" set \
|
||||||
|
of styles take precedence. The command-line arguments are the highest \
|
||||||
|
priority, followed by the BAT_STYLE environment variable, and then \
|
||||||
|
the configuration file. If any set of styles consists entirely of \
|
||||||
|
components prefixed with \"+\" or \"-\", it will modify the \
|
||||||
|
previous set of styles instead of replacing them.\n\n\
|
||||||
By default, the following components are enabled:\n \
|
By default, the following components are enabled:\n \
|
||||||
changes, grid, header-filename, numbers, snip\n\n\
|
changes, grid, header-filename, numbers, snip\n\n\
|
||||||
Possible values:\n\n \
|
Possible values:\n\n \
|
||||||
|
|
Loading…
Reference in New Issue