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

ag not printing empty files with -ul #956

Closed
HaleTom opened this issue Aug 15, 2016 · 2 comments
Closed

ag not printing empty files with -ul #956

HaleTom opened this issue Aug 15, 2016 · 2 comments

Comments

@HaleTom
Copy link
Contributor

HaleTom commented Aug 15, 2016

From the man page: (ag version 0.28.0)

   -l --files-with-matches
          Only print the names of files containing matches, not the matching lines. An empty query will print all files that would be searched.

   -u --unrestricted
          Search all files. This ignores .agignore, .gitignore, etc. It searches binary and hidden files as well.

So I'd expect ag -lu to list all files.

However:

+ravi@boxy:~$ mkdir new && cd new
+ravi@boxy:~/new$ echo stuff > non-empty && touch empty
+ravi@boxy:~/new$ ag -ul
non-empty
+ravi@boxy:~/new$
@HaleTom
Copy link
Contributor Author

HaleTom commented Aug 15, 2016

There has been some discussion (including code) at:
How do I force ag (the sliver searcher) to list empty files

HaleTom added a commit to HaleTom/the_silver_searcher that referenced this issue Aug 25, 2016
Fix issue ggreer#956:

`ag -ul` with an empty query should list all filenames, as the manual
says:

  -u --unrestricted
	  Search *all* files. ...

  -l --files-with-matches
	  ...An empty query will print all files that would be searched.
@ggreer
Copy link
Owner

ggreer commented Nov 25, 2016

Fixed in #957. Thanks!

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

No branches or pull requests

2 participants