garabik / grc

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

maths in grc formulas #158

Open withnale opened 4 years ago

withnale commented 4 years ago

Is there any way to write a formula that can make use of arithmetic functions, or is there a clean way of implementing this a new feature?

One example case springs to mind using grc with kubectl

NAME       READY   UP-TO-DATE   AVAILABLE   AGE
api1       1/1     1            1           33d
ui         1/1     1            1           33d
api2       2/2     2            1           33d
auth       3/4     1            1           33d
client     0/1     1            1           33d
event      1/1     1            1           33d
postgres   2/2     2            2           33d

In the above example:

lnxbil commented 1 year ago

grc is able to forward the found text to a program, maybe, you can fiddle around with this.