Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

DabeDotCom
Copy link

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

Squashed commit of the following:

commit 1ffe7e4
Author: Dabrien 'Dabe' Murphy <[email protected]>
Date:   Fri Dec 3 19:48:42 2021 -0500

    Implement 'output-color' Changes (TDD "Green")

commit bbf6ca1
Author: Dabrien 'Dabe' Murphy <[email protected]>
Date:   Fri Dec 3 19:47:11 2021 -0500

    Add Desired (TDD "Red") 'output-color' Test

commit 1fe31ee
Author: Dabrien 'Dabe' Murphy <[email protected]>
Date:   Fri Dec 3 19:07:14 2021 -0500

    Add Initial (Passing) `t/ack-output-color.t` Test

    NOTE: This serves to document *current* behavior
Squashed commit of the following:

commit 9f8ef37
Author: Dabrien 'Dabe' Murphy <[email protected]>
Date:   Fri Dec 3 20:26:10 2021 -0500

    Make `--no-lineno` and `--column`  Mutually Exclusive

    Turning line numbers off when you're showing "--column" output could
    lead to ambiguous results.

commit 7a7736f
Author: Dabrien 'Dabe' Murphy <[email protected]>
Date:   Fri Dec 3 20:09:35 2021 -0500

    Implement "--no-lineno" Functionality

commit 1512fd0
Author: Dabrien 'Dabe' Murphy <[email protected]>
Date:   Fri Dec 3 20:07:20 2021 -0500

    Add Initial "--no-lineno" Option

    NOTE: Not Yet Implemented
@n1vux
Copy link
Contributor

n1vux commented Dec 4, 2021

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

@petdance
Copy link
Collaborator

petdance commented Dec 5, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants