colorize: fix check for pygmentize (#7250)

This commit is contained in:
Marc Cornellà 2018-10-08 17:56:44 +02:00 committed by GitHub
parent 7b29684a30
commit 999d3ddf4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,9 @@
alias ccat='colorize_via_pygmentize'
colorize_via_pygmentize() {
if [ ! -x "$(which pygmentize)" ]; then
echo "package \'Pygments\' is not installed!"
return -1
if ! (( $+commands[pygmentize] )); then
echo "package 'Pygments' is not installed!"
return 1
fi
if [ $# -eq 0 ]; then