garabik / grc

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

Add colorization for route #232

Open codenyte opened 9 months ago

codenyte commented 9 months ago

Add colorization for the route command on Linux

iax7 commented 9 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 9 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 9 months ago

This is great, thanks