4 ms·
Indeed. Having to build configuration file for each command was a pain in the ass. Colout is better integrated in my shell workflow and shows that config files
by nojhan 13y ago
Indeed. Having to build configuration file for each command was a pain in the ass. Colout is better integrated in my shell workflow and shows that config files are not mandatory (but colout themes do just the same).
Plus, colout have a tons of additional features (256-colors mode, colormaps, etc.).
- lobster_johnson 13y agoReally? grcat/grc's configs are very simple. For example, this is the config for colorizing diffs: regexp=^\+(.*$) colours=bold green count=more ======= regexp=^\-(--.+$|[^\-].*$|$) colours=bold red count=more ======== regexp=^\>([^\>].*|$) colours=bold green count=more ======= regexp=^\<([^\<].*|$) colours=bold red count=more ======= regexp=^@@ .* @@$ colours=magenta count=more I agree that colout works better for ad-hoc stuff. You should consider inverting the way it's invoked, though, to be more like grc, otherwise you can't reliably use colout in an alias (as pointed out elsewhere in this thread).
- egonschiele 13y agoHaving just seen both utilities, colout looks very useful while grc looks like a PITA. I don't want to write configs for every adhoc command.
- lobster_johnson 13y agoYeah, grc is not for ad hoc utilities. It's meant to work with tools you use frequently, like make, diff, gcc, ping etc. where the syntax is known.
- nojhan 13y agoIt should not be too difficult to use the same config files in colout, btw.
- nojhan 13y agoYou can, it's just a matter of knowing how to write a function for your shell.
- nillian 13y agoExactly. ls example in zsh: alias ls="ls -lph1 --color=always" function ls { /bin/ls $@ | colout [regex] colours } This will pass all arguments after "ls" to the /bin/ls command. This also means you can keep your existing aliases clean and tidy for common params. Remember to use the full path (or /usr/bin/env maybe) so that you don't create a recursive call to your function ;) This doesn't deal with the situation of being unable to get the return value of the original command, but depending on your needs, this may not be an issue. (edited for spacing)
- lobster_johnson 13y agoI was referring to the exit code problem. Is it solvable?