regex command patterns in grc.conf are wrong
lets take 'du' as an example:
# du
(^|[/\w\.]+/)du\s?
conf.du
what you actually wanted was:
(^|^[/\w\.]+/)du\s?
it's because otherwise if I'd issue
du -sh ./dig.txt
the conf.dig would be used to colorize du output because its regex comes before the one for 'du'
Still, having '(^|^[/\w.]+/)' won't help because neither './du' nor '/usr/bin/du' are aliased. So if I use '/usr/bin/du -sh *' then no grc be called at all.
Just to clarify, './du' and '/usr/bin/du' (and also '\du') are standard ways to bypass aliases, at least on sh-compatible shells, so those forms shouldn't actually be matched by the regex.
I agree with your other point though.
Just to clarify, './du' and '/usr/bin/du' (and also '\du') are standard ways to bypass aliases, at least on sh-compatible shells, so those forms shouldn't actually be matched by the regex.
that's what I was trying to say. To my opinion proper regex for du case would be just
^du\s?
Just to clarify, './du' and '/usr/bin/du' (and also '\du') are standard ways to bypass aliases, at least on sh-compatible shells, so those forms shouldn't actually be matched by the regex.
Yes, you are right. When starting with grc, I was trying to be as inclusive as possible, which was not the best idea.
that's what I was trying to say. To my opinion proper regex for du case would be just
^du\s?
Or ^du\b, otherwise it will match any command beginning with du....
hello, I've seed that you've changed the du case in the devel branch. But it's generic problem that is applied for all commands, not just du!
Re-thinking the issue, I left the entries with the paths (while fixing superfluous matching). After all, since it is not aliased, it will only apply if you deliberately invoke grc (with grc /usr/bin/du) and then you probably want it to apply...