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
Arguments silently ignored in filter mode #270
Comments
Another option to the three for expected behavior I listed above: use the presence/absence of --[no]filter to determine what to do. Specifically:
In fact, if my suggested behavior was adopted, then the --filter option can be removed. Instead of using --nofilter, you would instead redirect stdin from </dev/null. Instead of --filter, you would use "-" or "/dev/stdin". (Whenever I say /dev/stdin, I really mean to say also allow "-" if ack is changed to interpret it as stdin, since I know /dev/stdin isn't universal.) The quick "type This has breaking changes per-project/user .ackrc using --[no]filter, but I think such would be acceptable as I don't imagine this option is ever used in .ackrc. Do you have a system in place for deprecating --[no]filter? Or should it just be removed, giving an error if specified? I'd like to try my hand at implementing this. |
Twelve hours later... at least I know some perl now. :) Please let me know if I wrote non-idiomatic code, I tried to follow project conventions. In particular, using |
Ack silently ignores given filenames in filter mode. Expected behavior is to either ignore stdin (this is what grep does), search the specified arguments in addition to stdin, or warn/error. Actual behavior is to silently ignore the arguments. Examples:
Tested against http://beyondgrep.com/ack-2.14-single-file on Ubuntu 14.04.
The last example, with /dev/stdin, doesn't make sense in isolation. I started with "-" instead, then found out ack doesn't treat "-" to mean "read stdin". I didn't think that warranted a separate issue, but any fix to this bug could address that too. (edit: it was a deeper problem than I expected, see #269)
The text was updated successfully, but these errors were encountered: