mirror of
https://github.com/sharkdp/bat.git
synced 2025-10-29 22:24:35 +00:00
Syntax: add cmd-help (#2148)
* Add cmd-help syntax To highlight command --help messages. * README.md: mention help message highlighting * README.md: edit help message highlighting
This commit is contained in:
committed by
GitHub
parent
3239d3be2a
commit
b0898900ce
18
README.md
18
README.md
@@ -212,6 +212,24 @@ Also, note that this will [not work](https://github.com/sharkdp/bat/issues/1145)
|
||||
|
||||
The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
|
||||
|
||||
#### Highlighting `--help` messages
|
||||
|
||||
You can use `bat` to colorize help text: `$ cp --help | bat -plhelp`
|
||||
|
||||
You can also use a wrapper around this:
|
||||
|
||||
```bash
|
||||
# in your .bashrc/.zshrc/*rc
|
||||
alias bathelp='bat --plain --language=help'
|
||||
help() {
|
||||
"$@" --help 2>&1 | bathelp
|
||||
}
|
||||
```
|
||||
|
||||
Then you can do `$ help cp` or `$ help git commit`.
|
||||
|
||||
Please report any issues with the help syntax in [this repository](https://github.com/victor-gp/cmd-help-sublime-syntax).
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user