Show HN: Grep with colours written in Go
41–50 of 90 posts
Re: Show HN: Grep with colours written in Go
#42Is this speed competitive with tools like the silver searcher (`ag`) or is the focus here on color?
Here's an excellent write-up on how it works, benchmarks, etc.: https://blog.burntsushi.net/ripgrep/
Re: Show HN: Grep with colours written in Go
#43Re: Show HN: Grep with colours written in Go
#44Re: Show HN: Grep with colours written in Go
#45Do be sure to at least consider supporting no colour! http://no-color.org
Re: Show HN: Grep with colours written in Go
#46Is this speed competitive with tools like the silver searcher (`ag`) or is the focus here on color?
A quick look at the source shows that it appears to be linear and just uses `strings.Contains` or `r.MatchString` on each line, so I don't think it has any of the optimizations that are built into `ag`.
Re: Show HN: Grep with colours written in Go
#47But... Can it elegantly suppress broken pipe errors?
Re: Show HN: Grep with colours written in Go
#48Nice job! Language-specific coloring is really nice! I'll give it a try. I normally use a different Golang tool called sift as my grep replacement (which I love so far): https://github.com/svent/sift Sift's goals seem to be mostly performance (it is super fast), but it would be nice to have some of these more sophisticated coloring features in there as well, as they are useful.
Re: Show HN: Grep with colours written in Go
#49Is this speed competitive with tools like the silver searcher (`ag`) or is the focus here on color?
As much as I love `ag`, I feel like ripgrep ( https://github.com/BurntSushi/ripgrep ) deserves mentioning when it comes to speed. If you haven't tried it, do it sooner rather than later. Here's an excellent write-up on how it works, benchmarks, etc.: https://blog.burntsushi.net/ripgrep/
Re: Show HN: Grep with colours written in Go
#50Earlier quoted context omitted.
I don't understand why this is a standard. First: It requires that every command line tool add support for this environment variable. It may not be much effort for each project, but it adds up to a ton of developer time. Even if this standard gains traction, some apps will slip through the cracks. So in the success case, many users will still be annoyed that one or two of their tools print colors when they shouldn't.…
What if someone needs colors, but not colors that util maker used? What if two or more tools make different use of colors? With terminal aware of that problem you can remap or erase specific colors, but maybe it’s wiser to not create a problem at all, since just making text bold may be enough for practical needs. Edit: missing not
Another workaround is to merely pipe the output to a file in certain cases.