Simplify cat-highlight
This commit is contained in:
parent
283971e3ad
commit
0cd89f0788
|
@ -33,9 +33,9 @@ function cat-highlight()
|
||||||
{
|
{
|
||||||
# Check if we are in a terminal and $LESSOPEN is not empty
|
# Check if we are in a terminal and $LESSOPEN is not empty
|
||||||
if [[ -t 1 && -n "${LESSOPEN}" ]]; then
|
if [[ -t 1 && -n "${LESSOPEN}" ]]; then
|
||||||
CATOPEN="${LESSOPEN/| }"
|
# Works only if command understands - as stdin
|
||||||
CATOPEN="${CATOPEN/ %s}"
|
CATOPEN="${LESSOPEN/\%s/-}"
|
||||||
\cat $@ | eval ${CATOPEN}
|
eval "\cat $@ ${CATOPEN}"
|
||||||
else
|
else
|
||||||
\cat $@
|
\cat $@
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user