]> git.gir.st - ircpipe.git/commit
provide a tool to highlight irc protocol messages
authorTobias Girstmair <t@thi3nkpad.localdomain>
Sat, 25 May 2024 20:14:57 +0000 (22:14 +0200)
committerTobias Girstmair <t@thi3nkpad.localdomain>
Sat, 25 May 2024 20:30:56 +0000 (22:30 +0200)
commit5be0be585cba9790799d2b3af801f43fdf5a2f0e
tree97d5edd28c51fba2f8ffee89fd691476bc442b46
parent65030ac5e572a6a3b8ef3d2a17c18fe985b7d1d8
provide a tool to highlight irc protocol messages

this can be used as a bare-bones irc client like so:
  IRC_PASSWD=... ./ircpipe -n $NICK -p -s $BOUNCER_HOST | ./highlight | ts
('ts' being the timestamping tool from moreutils)

the code for this looks a bit wonky, but that's kind of on purpose:
while we first parse the message, we then not use this for actual output
and instead slice the raw line and splice in control sequences, as to
not accidentally modify the input; copy-pasting from it should yield the
same bytes as it processed (modulo mIRC style color control chars).
using bytes instead of native strings is necessary as to not break on
non-utf8-encoded messages, something that regularly happens in practise.
contrib/highlight [new file with mode: 0755]
Imprint / Impressum