garabik / grc

generic colouriser
http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
Other
1.9k stars 162 forks source link

Add colorization for route #232

Open codenyte opened 11 months ago

codenyte commented 11 months ago

Add colorization for the route command on Linux

iax7 commented 11 months ago

The problem with route command is that the command is a bit slow. GRC colorizes after the command exits.

TLDR; You will have no output until the command finishes. In my tests, about 17 seconds

iax7 commented 11 months ago

I did a quick mock up: image

This is the file I used:

# Network DEFAULT
regexp=\bdefault\b
colours=on_green bold black
-
# IP
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
colours=magenta
-
# Mask
regexp=(?<=255)((\.0)+)
colours=bold magenta
-
# all host
regexp=0\.0\.0\.0
colours=bright_black
-
# Flags
regexp=\b[UHGRDMAC!]+\b
colours=yellow
-
# iface
regexp=(?<=\d\s)\b[-\w\d]+$
colours=cyan
codenyte commented 11 months ago

This is great, thanks