Unverified Commit 23688fc7 authored by Iulian Onofrei's avatar Iulian Onofrei Committed by GitHub
Browse files

Add option to color any help command

This allows you to use `colored git log --help` for example, to get
colored output.
parent b4007b54
...@@ -16,7 +16,7 @@ EOF ...@@ -16,7 +16,7 @@ EOF
fi fi
fi fi
function man() { function colored() {
env \ env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \
...@@ -28,5 +28,9 @@ function man() { ...@@ -28,5 +28,9 @@ function man() {
PAGER="${commands[less]:-$PAGER}" \ PAGER="${commands[less]:-$PAGER}" \
_NROFF_U=1 \ _NROFF_U=1 \
PATH="$HOME/bin:$PATH" \ PATH="$HOME/bin:$PATH" \
man "$@" "$@"
}
function man() {
colored man "$@"
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment