ATM I can see that the --color flag does work interactively. However when piping to other commands (such as head or tail) then the flag no longer works.
I checked around and this appears to be because the sending program (your program pup in this particular instance). Is switching off colors for non interactive output.
This is actually a desirable characteristic. Unfortunately it cannot be overriden. Wheras other standard linux commands have a special flags to force color to be piped always. For example:
Works fine. This shows me that it's not actually the receiving command (for example head in this example). That is not the thing taking the colors away.
Please see if there is any way that you can add this feature within the Go frameworks / libs environment. Thank you. BTW it might also be interesting to see what jq is doing too. Since this program is intended to be similar to jq. I would then like to request that feature over there if it's also missing from jq. Just haven't checked up on that yet. Kind Regards.
ATM I can see that the
--colorflag does work interactively. However when piping to other commands (such asheadortail) then the flag no longer works.I checked around and this appears to be because the sending program (your program
pupin this particular instance). Is switching off colors for non interactive output.This is actually a desirable characteristic. Unfortunately it cannot be overriden. Wheras other standard linux commands have a special flags to force color to be piped always. For example:
ls --color=always | headWorks fine. This shows me that it's not actually the receiving command (for example
headin this example). That is not the thing taking the colors away.Please see if there is any way that you can add this feature within the Go frameworks / libs environment. Thank you. BTW it might also be interesting to see what
jqis doing too. Since this program is intended to be similar tojq. I would then like to request that feature over there if it's also missing fromjq. Just haven't checked up on that yet. Kind Regards.