]> git.gir.st - ircpipe.git/commit
provide a tool to highlight irc protocol messages
authorTobias Girstmair <tobi@isticktoit.net>
Sat, 25 May 2024 20:14:57 +0000 (22:14 +0200)
committerTobias Girstmair <tobi@isticktoit.net>
Sat, 25 May 2024 20:30:56 +0000 (22:30 +0200)
commit1e302bac7d786056ac7224bd045d5f7706adb1eb
tree97d5edd28c51fba2f8ffee89fd691476bc442b46
parent1bae634443a71a6d47e7702a6b59e5c464adce57
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