falconindy / expac

alpm data extraction utility
91 stars 15 forks source link

color codes not interpreted anymore (expac-git) #16

Closed rmarquis closed 10 years ago

rmarquis commented 10 years ago

In a script, I'm using expac in a way that mimics cower output:

expac -S -1 ":: %n is available in %r" ${arrayofpackages[@]}

This works great, and I'm doing it the same way as above but with color codes:

expac -S -1 "\e[1;33m::\e[0m \e[1;39m%n\e[0m is available in \e[1;35m%r\e[0m" ${arrayofpackages[@]}

This correctly results in the following colored output:

:: apache-ant is available in extra
:: avrdude is available in community
:: avr-gcc is available in community
:: avr-libc is available in community
...

However, there is a regression when using the latest expac-git, and the colored output doesn't display as expected anymore:

[1;33m::[0m [1;39mapache-ant[0m is available in [1;35mextra[0m
[1;33m::[0m [1;39mavrdude[0m is available in [1;35mcommunity[0m
[1;33m::[0m [1;39mavr-gcc[0m is available in [1;35mcommunity[0m
[1;33m::[0m [1;39mavr-libc[0m is available in [1;35mcommunity[0m
...

Is this an unwanted side effect of the recent changes, or does this seem to be a new normal behavior?

falconindy commented 10 years ago

No, not intended. I'll figure out a fix.

falconindy commented 10 years ago

7a7340505092c3b61d9a084a11f6ac895481c593 should resolve this...

rmarquis commented 10 years ago

Indeed, the bug is now fixed. Many thanks for taking care of this! :)