beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

Add -I flag (capital -i) as alias for --no-smart-case #613

Closed petdance closed 6 years ago

petdance commented 7 years ago

This should be pretty easy to add to 2.18.

Tomaz-Vieira commented 7 years ago

Won't this go against the grep-likeness that ack proposes? The -I flag is used to ignore binary files in grep. Perhaps some other char like -N ?

petdance commented 7 years ago

Thanks for the thoughts. Here's why I'm going with -I.

There are plenty of places where ack diverts from grep, and this is one of them. My first priority is to make ack's flag match what grep's flag for the same functionality is. grep doesn't have functionality to ignore previous -i and --smart-case. Also, I don't mind conflicting with grep's -N because ack doesn't have that functionality to optionally ignore binary files. It's what ack does always.

Finally, and this is probably the biggest, I try to make the capital version of an option be the negation of the lowercase version. That's why -I makes sense as -i.

I just implemented -I the other day in ack3 (currently in development). I wish I'd implemented it long ago in ack2, because I find myself using it all the time now.

petdance commented 6 years ago

I'm not going to add this to ack2.