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

ack does not search stdin from terminal #603

Closed
fazjaxton opened this issue Jul 1, 2016 · 6 comments
Closed

ack does not search stdin from terminal #603

fazjaxton opened this issue Jul 1, 2016 · 6 comments

Comments

@fazjaxton
Copy link

From the help text:

ack may also search STDIN, but only if no file or directory arguments are
specified, or if one of them is "-".

However, when no files are specified, ack recursively searches the current directory:

ack .

And when "-" is specified, it is treated as a file name:

$ ack . -
ack: -: No such file or directory

I understand the usefulness of the first case, as this is probably what people mean 90+% of the time, but when the user explicitly asks for stdin (as in the second case), it would be nice to let them have it.

@petdance
Copy link
Collaborator

petdance commented Jul 1, 2016

You're asking it to both descend through a tree AND search stdin. I don't see how that would make sense to do.

@fazjaxton
Copy link
Author

I don't want it to search through the tree. In this case I mean "." as the pattern (matching anything). The results are equivalent with "a":

$ ack a

searches the tree, and:

$ ack a -
ack: -: No such file or directory

@petdance
Copy link
Collaborator

petdance commented Jul 1, 2016

Ah, ok, you want ack foo --filter.

@petdance
Copy link
Collaborator

petdance commented Jul 1, 2016

  --[no]filter                  Force ack to treat standard input as a pipe
                                (--filter) or tty (--nofilter)

@fazjaxton
Copy link
Author

Oh, great! Thanks! Sorry, should have found that myself. :)

@petdance
Copy link
Collaborator

petdance commented Jul 1, 2016

Not a problem. It took me a minute to find it myself. :-)

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

No branches or pull requests

2 participants