beyondgrep / ack3

ack is a grep-like search tool optimized for source code.
https://beyondgrep.com/
Other
713 stars 66 forks source link

Add `--no-lineno` Option to Omit Line Numbers #351

Open DabeDotCom opened 2 years ago

DabeDotCom commented 2 years ago

There's no way to produce the same output as grep:

grep -H ^root: /etc/passwd
/etc/passwd:root:*:0:0:System Administrator:/var/root:/bin/sh

ack --no-heading -H ^root: /etc/passwd 
/etc/passwd:12:root:*:0:0:System Administrator:/var/root:/bin/sh

This PR fixes lets you:

ack --no-heading -H --no-lineno ^root: /etc/passwd
/etc/passwd:root:*:0:0:System Administrator:/var/root:/bin/sh
n1vux commented 2 years ago

It is not immediately obvious if this PR addresses the previously discussed issue #311 head-on, or is only approximately the same issue.

petdance commented 2 years ago

There is a lot to discuss about this. I don't think it makes sense to have a --no-lineno to force off line numbers without a --lineno to force them on, which is something that people have wanted for a while.

Let's move this discussion over to the original ticket at #142.