GRCAT(1)

πŸ’– NAME πŸ’–

grcat β€” bestie, it reads from standard input, colourises it, and writes it straight to standard output. that's the whole vibe. ✨

🌸 SYNOPSIS 🌸

grcat configuration

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so configuration is the name of a configuration file. the program goes hunting for it in these directories, in exactly this order:

  1. ~/.grc/
  2. /usr/local/share/grc/
  3. /usr/share/grc/

if it doesn't find the file in any of those, it just assumes what you typed is an absolute path of a configuration file located elsewhere. no cap. 🫢

so the configuration file is made of entries, one per regexp, and entries are separated with lines whose first character is non-alphanumeric (except #). lines beginning with # and empty lines get ignored. periodt. πŸ’…

each entry is several lines. each line has the form:

keyword=value

where keyword is one of: regexp, colours, command, concat, skip, count. only regexp is mandatory, but ngl it does not have much sense by itself unless you specify at least a colour or command keyword as well.

  • regexp β€” the regular expression to match. the main character of the whole operation. πŸ‘‘
  • colours β€” the list of colours, separated by commas (you can specify only one colour), each colour per one regexp group specified in regexp.
  • command β€” the command to be executed when regexp matches. its output will be mixed with normal stdout, so use redirectors ( >/dev/null) if you want to supress it.
  • replace β€” means the regular expression match will be replaced by the value. all the preceeding regular expressions will be evaluated against the original text, all the following regular expressions will be evaluated against the replaced text.
  • skip β€” can be either yes, or no. if yes, the matched line will be skipped and not displayed in output. default is no.
  • count β€” one of the words: once, more, or stop.
    • once means that if the regexp is matched, its first occurrence is coloured and the program will continue with other regexp's.
    • more means that if there are multiple matches of the regexp in one line, all of them will be coloured.
    • stop means that the regexp will be coloured and program will move to the next line (i.e. ignoring other regexp's).

regular expressions are evaluated from top to bottom, and honestly that's the slay part β€” it's what lets you do nested and overlapped expressions. (e.g. you colour everything inside parentheses with one colour, and if a following expression matches the text inside parentheses, it will be also coloured) πŸŽ€


✨ OPTIONS ✨

  • None so far. πŸ™ˆ (genuinely nothing to tune here, it's giving minimalism)

πŸ‘‘ SEE ALSO πŸ‘‘

grc(1)

πŸ’œ AUTHOR πŸ’œ

Written by Radovan GarabΓ­k <garabik @ kassiopeia.juls.savba.sk>


and that's the whole page bestie πŸ’– this was GRCAT(1), living in the General Commands Manual β€” section 1, icon behaviour only. go colourise something. πŸŒˆπŸ¦‹πŸ’