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

counsel-rg's extra arguments do not support additional paths to search from #1498

Closed
rieje opened this Issue Mar 21, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@rieje

rieje commented Mar 21, 2018

According to man rg, any paths as the last arguments to the command are paths to search from. However, using the universal argument C-u counsel-rg to prompt counsel-rg for extra arguments and specifying a path as an argument will result in counsel-rg not showing results from this path and from the initial/default path, so the search results will always have nothing.

Example: C-u counsel-rg, enter ~/bin as initial directory to search for, enter ~/.emacs.d as an argument when prompted, and any string you search will return 0 results even if that string is in ~/bin.

Saw this issue posted on /r/emacs, so might as well submit a GH issue.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Mar 22, 2018

Owner

Thanks for the report. Could you add the full command line that does what you want with ~/bin?

Owner

abo-abo commented Mar 22, 2018

Thanks for the report. Could you add the full command line that does what you want with ~/bin?

@rieje

This comment has been minimized.

Show comment
Hide comment
@rieje

rieje Mar 22, 2018

Yes, it's very simple: rg bash ~/bin ~/documentation (rg <pattern> [path...]). Based on what I've found, the order of the paths don't matter as specifying any path as an extra argument in addition to counsel-rg's initial path will not yield any results.

rieje commented Mar 22, 2018

Yes, it's very simple: rg bash ~/bin ~/documentation (rg <pattern> [path...]). Based on what I've found, the order of the paths don't matter as specifying any path as an extra argument in addition to counsel-rg's initial path will not yield any results.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 5, 2018

Owner

OK, here's how I made it work (no code changes needed):

  • enter ~/bin as the initial dir as you do already
  • enter -- ~/.emacs.d as the extra args

Let me know if it works for you.

Owner

abo-abo commented Jul 5, 2018

OK, here's how I made it work (no code changes needed):

  • enter ~/bin as the initial dir as you do already
  • enter -- ~/.emacs.d as the extra args

Let me know if it works for you.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 5, 2018

Owner

Note the space before --.

Owner

abo-abo commented Jul 5, 2018

Note the space before --.

@rieje

This comment has been minimized.

Show comment
Hide comment
@rieje

rieje Jul 6, 2018

Thanks, that works for me. Glad you mentioned the space before --, Github didn't show that. On reddit, you linked the related issue--I'm guessing that PR will solve this issue of needing to put a space before -- or remove the need for using -- altogether? You can decide whether to close this issue.

rieje commented Jul 6, 2018

Thanks, that works for me. Glad you mentioned the space before --, Github didn't show that. On reddit, you linked the related issue--I'm guessing that PR will solve this issue of needing to put a space before -- or remove the need for using -- altogether? You can decide whether to close this issue.

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jul 9, 2018

Owner

Thanks, fixed. The extra initial space is no longer needed.

Owner

abo-abo commented Jul 9, 2018

Thanks, fixed. The extra initial space is no longer needed.

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