1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-24 17:00:47 +00:00

Add option to color any help command

This allows you to use `colored git log --help` for example, to get
colored output.
This commit is contained in:
Iulian Onofrei 2018-09-29 17:01:41 +03:00 committed by GitHub
parent b4007b5400
commit 23688fc7ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ EOF
fi
fi
function man() {
function colored() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
@ -28,5 +28,9 @@ function man() {
PAGER="${commands[less]:-$PAGER}" \
_NROFF_U=1 \
PATH="$HOME/bin:$PATH" \
man "$@"
"$@"
}
function man() {
colored man "$@"
}