ccat icon indicating copy to clipboard operation
ccat copied to clipboard

Colorize other commands

Open artemgurzhii opened this issue 7 years ago • 2 comments
trafficstars

Is there any chance of adding colorizing to the other commands, like tail/head/more/less, etc?

As an option, you can forward all arguments to the command(let's take tail as an example).

Assuming this command was passed to the console - ctail -20 ~/Folder1/folder2/.file It can be transformed into something like tail -20 ~/Folder1/folder2/.file | ccat

As for now, we can manually add support for this. Just add

ctail() {
  tail "$@" | ccat
}

to your bash config file(and same for all other functions, if needed). But it would be great to have those functions as built-in, without the need of transforming your bash config file.

artemgurzhii avatar Feb 16 '18 16:02 artemgurzhii

nope @artemgurzhii this workaround doesn't work

ctail() {
  tail "$@" | ccat
}

when you use the tail -f option

binarykitchen avatar Apr 03 '19 22:04 binarykitchen

You can overwrite builtin command, e.g:

function ls() {
    command ls "$@" | ccat
}

tmpm697 avatar Jan 10 '20 08:01 tmpm697