Live data from Hacker News

Show HN: Grep with colours written in Go

github.com

31–40 of 90 posts

Re: Show HN: Grep with colours written in Go

#32
post #20
post #6

Useless use of cat candidate.

This is one of my pet peeves - complaining about technically unnecessary, but fully benign uses of cat. Yes, 'cat FILENAME | blush "some text"' and 'blush "some text" So, yes, its unnecessary. And, yes, in a script using cat like that can complicate error handling. But, for interactive use, what advice exactly are you trying to convey?

The alternative would be `blush "some text" FILENAME`, which would work with sudo.

Re: Show HN: Grep with colours written in Go

#33

Do be sure to at least consider supporting no colour! http://no-color.org

Genuinely curious, why do some developers prefer not having colors for ls, grep, etc.? no-color.org mentions that many users prefer having colors disabled, but didn't list any reasons why.

I turned most colors off many years ago. For me it was because several tools (especially ls) used colors that were very hard to distinguish with my terminal background. I found myself spending too much time trying to figure out what was on my screen.

Another bonus is that I don't feel cheated when I log into systems that don't support colors (*BSD, Solaris, etc). Everything just looks normal to me. Even non-syntax highlighted vi (not vim).

Re: Show HN: Grep with colours written in Go

#34
post #18

Earlier quoted context omitted.

I could be wrong, but I read valarauca1's comment as "I’m doubtful. ag and rg use a lot of smart optimizations to get their speed."

lol people's reading comprensión is so bad sometimes

In fairness, it's the GPs fault on this occasion for not punctuating his or her post. Decarep just read the GPs post as it was literally written (I had to read it 3 times myself to gauge what I thought the post meant).

Re: Show HN: Grep with colours written in Go

#35
post #20
post #6

Useless use of cat candidate.

This is one of my pet peeves - complaining about technically unnecessary, but fully benign uses of cat. Yes, 'cat FILENAME | blush "some text"' and 'blush "some text" So, yes, its unnecessary. And, yes, in a script using cat like that can complicate error handling. But, for interactive use, what advice exactly are you trying to convey?

[deleted]

Re: Show HN: Grep with colours written in Go

#36
post #33

Earlier quoted context omitted.

Genuinely curious, why do some developers prefer not having colors for ls, grep, etc.? no-color.org mentions that many users prefer having colors disabled, but didn't list any reasons why.

I turned most colors off many years ago. For me it was because several tools (especially ls) used colors that were very hard to distinguish with my terminal background. I found myself spending too much time trying to figure out what was on my screen. Another bonus is that I don't feel cheated when I log into systems that don't support colors (*BSD, Solaris, etc). Everything just looks normal to me. Even non-syntax hi…

The tools don't exactly choose the color. They choose a color name from a palette. Your terminal's theme defines that palette.

If your terminal has a background very close to one of the colors on that palette, that is a theme problem, not an app problem.

Re: Show HN: Grep with colours written in Go

#37
post #20
post #6

Useless use of cat candidate.

This is one of my pet peeves - complaining about technically unnecessary, but fully benign uses of cat. Yes, 'cat FILENAME | blush "some text"' and 'blush "some text" So, yes, its unnecessary. And, yes, in a script using cat like that can complicate error handling. But, for interactive use, what advice exactly are you trying to convey?

A solution that I personally prefer, because the common form looks weird for me:

< FILENAME blush "some text"

Re: Show HN: Grep with colours written in Go

#38
post #16
post #4

Is this speed competitive with tools like the silver searcher (`ag`) or is the focus here on color?

I'm okay with it being not as fast because speed is not the goal here, but rather highlighting specific patterns to make it easier to spot for the human eyes, especially when tailing log lines from your development webserver.

> "to make it easier to spot for the human eyes,"

I suppose in that sense it does aim to be fast. Fast for the human to parse.

Re: Show HN: Grep with colours written in Go

#39

Do be sure to at least consider supporting no colour! http://no-color.org

Genuinely curious, why do some developers prefer not having colors for ls, grep, etc.? no-color.org mentions that many users prefer having colors disabled, but didn't list any reasons why.

Colorless is not my cup of tea, but here is one perspective I read a few years ago: http://www.linusakesson.net/programming/syntaxhighlighting/i...

HN discussion: https://news.ycombinator.com/item?id=3717303

Re: Show HN: Grep with colours written in Go

#40
post #20
post #6

Useless use of cat candidate.

This is one of my pet peeves - complaining about technically unnecessary, but fully benign uses of cat. Yes, 'cat FILENAME | blush "some text"' and 'blush "some text" So, yes, its unnecessary. And, yes, in a script using cat like that can complicate error handling. But, for interactive use, what advice exactly are you trying to convey?

I've found that unnecessary use of cat can sometimes have a noticeable performance impact, and I suspect that on the right system with the right filesizes this could be one of those circumstances. (Obviously it doesn't matter one whit with small files.)
Post reply on HN