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
|
||||
if [[ -t 1 && -n "${LESSOPEN}" ]]; then
|
||||
CATOPEN="${LESSOPEN/| }"
|
||||
CATOPEN="${CATOPEN/ %s}"
|
||||
\cat $@ | eval ${CATOPEN}
|
||||
# Works only if command understands - as stdin
|
||||
CATOPEN="${LESSOPEN/\%s/-}"
|
||||
eval "\cat $@ ${CATOPEN}"
|
||||
else
|
||||
\cat $@
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user