Any software should default to the options that make most sense to the most users in most situations.
For a grep tool, I would expect it to:
- ignore hidden/ignored files (ie. no build artifacts, no vcs files, etc)
- pipe it's output through a pager (when running in a tty)
- show color output (when running in a tty)
ugrep
already does the third, but not the other two.
This is especially frustrating, as ugrep
apparently already supports these modes of operation, but requires you (read, every first time user of the software) to read through a massive README file in order to find out how to enable these options, then write some shell aliases for them (as apparently, there is no configuration file?).
Context: I was so used to git grep
, and missed it a lot when we switched to Mercurial. Ordinary grep
gives tons of unwanted results from inside .hg
and temporary build products, which git grep
didn't. Luckily I stumbled upon ag
, which did exactly what I was looking for, so I never looked back to grep
.
Unfortunately it currently has a bug where it ignores all VCS ignore files, so I looked for alternatives (there are quite a few now, and interestingly, every single one is faster then all the others!). None of these did what ag
did.
ugrep
was one of the alternatives I tried, and I spent the better part of an hour to make any sense of it (the README
is, sorry, quite intimidating), and try to get it to do what seemed reasonably to me (ignore .hg
, and ignore everything from .hgignore
. And in the end I gave up, did a simple ln -s .hgignore .ignore
(workaround for the ag
bug), and now happily continue to use ag
.
I also read the stanza about people who have never heard of shell aliases. That's what prompted me to spent another 20min writing this entry, as I very strongly disagree. Yes, I am very well aware of shell aliases, and, No, I do not think that every first time user should be required to write these in order to use the tool in a meaningful way. The default behaviour of the tool is what every new user sees for the first time, and if it doesn't make sense, some of them will just walk away and never look back.