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

Allows files argument to be parsed to ag/search #157

Merged
merged 1 commit into from
Jul 26, 2019

Conversation

vitorqb
Copy link
Contributor

@vitorqb vitorqb commented May 30, 2019

Gives ag/search an optional files parameter. If parsed, give this
list of files to ag instad of the current directory (".").

I find this usefull because I use org-journal, and now I can do
something like this to search with ag between two dates, for example
2019-15-5->2019-05-31:

(let* ((start (org-journal-calendar-date->time '(5 15 2019)))
       (end   (org-journal-calendar-date->time '(5 31 2019)))
       (files (sort (org-journal-search-build-file-list start end) #'string<)))
  (ag/search "foo" "~/Documents/journal" :files files))

@coveralls
Copy link

coveralls commented May 30, 2019

Coverage Status

Coverage remained the same at 18.773% when pulling 609d047 on vitorqb:allow-file-list-on-ag-search into 77b4f50 on Wilfred:master.

@Wilfred
Copy link
Owner

Wilfred commented Jul 23, 2019

I don't mind adding an extra keyword parameter to ag/search, but why have you added an extra -H argument to ag?

Gives `ag/search` an optional `files` parameter. If parsed, give this
list of files to ag instead of the current directory (".").

I find this useful because I use org-journal, and now I can do
something like this to search with ag between two dates, for example
2019-15-5->2019-05-31:

```
(let* ((start (org-journal-calendar-date->time '(5 15 2019)))
       (end   (org-journal-calendar-date->time '(5 31 2019)))
       (files (sort (org-journal-search-build-file-list start end) #'string<)))
  (ag/search "foo" "~/myorg/journal-elements/" :files files))
```
@vitorqb vitorqb closed this Jul 25, 2019
@vitorqb vitorqb force-pushed the allow-file-list-on-ag-search branch from 54248bf to 77b4f50 Compare July 25, 2019 18:14
@vitorqb
Copy link
Contributor Author

vitorqb commented Jul 25, 2019

Sorry, my mistake. For some reason i thought it would only working with the -H flag, but I did some tests now and I think I was wrong.

@vitorqb vitorqb reopened this Jul 25, 2019
@Wilfred Wilfred merged commit bd81d68 into Wilfred:master Jul 26, 2019
@Wilfred
Copy link
Owner

Wilfred commented Jul 26, 2019

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

Successfully merging this pull request may close these issues.

3 participants