mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-26 20:16:33 +00:00
docs: add instructions for removing fish help abbreviations
Add documentation showing how to erase the fish abbreviations for --help and -h, since the dash-prefixed names make removal non-obvious. The key is using -- before the abbreviation name to prevent fish from interpreting it as a flag. Closes #3536
This commit is contained in:
2 files changed
+13
No files matched your search
@@ -1,6 +1,10 @@
|
|||||||
# unreleased
|
# unreleased
|
||||||
|
|
||||||
|
|
||||||
|
## Other
|
||||||
|
|
||||||
|
- Add instructions for removing fish help abbreviations to README, see #3655 (@claw-explorer). Closes #3536
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Preserve `--diff` change markers and snip separators when `--plain` is set. Closes #3630, see #3643 (@mvanhorn)
|
- Preserve `--diff` change markers and snip separators when `--plain` is set. Closes #3630, see #3643 (@mvanhorn)
|
||||||
|
|||||||
@@ -244,6 +244,15 @@ abbr -a --position anywhere -- --help '--help | bat -plhelp'
|
|||||||
abbr -a --position anywhere -- -h '-h | bat -plhelp'
|
abbr -a --position anywhere -- -h '-h | bat -plhelp'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To remove these abbreviations later:
|
||||||
|
|
||||||
|
```fish
|
||||||
|
abbr -e -- --help
|
||||||
|
abbr -e -- -h
|
||||||
|
```
|
||||||
|
|
||||||
|
The `--` before the abbreviation name is required because `--help` and `-h` start with dashes, which would otherwise be interpreted as flags to `abbr` itself.
|
||||||
|
|
||||||
This way, you can keep on using `cp --help`, but get colorized help pages.
|
This way, you can keep on using `cp --help`, but get colorized help pages.
|
||||||
|
|
||||||
Be aware that in some cases, `-h` may not be a shorthand of `--help` (for example with `ls`). In cases where you need to use `-h`
|
Be aware that in some cases, `-h` may not be a shorthand of `--help` (for example with `ls`). In cases where you need to use `-h`
|
||||||
|
|||||||
Reference in new issue
Block a user