ack3 icon indicating copy to clipboard operation
ack3 copied to clipboard

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

Open DabeDotCom opened this issue 3 years ago • 2 comments

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

DabeDotCom avatar Dec 04 '21 02:12 DabeDotCom

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

n1vux avatar Dec 04 '21 03:12 n1vux

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.

petdance avatar Dec 05 '21 22:12 petdance