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

Print glob text with glob error message #444

Closed
roblourens opened this issue Apr 10, 2017 · 2 comments
Closed

Print glob text with glob error message #444

roblourens opened this issue Apr 10, 2017 · 2 comments
Labels
enhancement An enhancement to the functionality of the software.

Comments

@roblourens
Copy link
Contributor

When I have an invalid glob:

$ rg -g "foo" -g "bar" -g "**.txt" foobar
invalid use of **; must be one path component

$ rg -g "foo" -g "bar" -g "{{}}" foobar
nested alternate groups are not allowed

There is an error printed, and the search doesn't continue, but it may not be obvious which glob is causing the issue. This comes up in microsoft/vscode#24050 but I imagine it may be useful for command line users to have a message like

Invalid glob "{{}}", nested alternate groups are not allowed

@BurntSushi BurntSushi added the enhancement An enhancement to the functionality of the software. label Apr 10, 2017
@BurntSushi
Copy link
Owner

Fully agreed that the error message should be improved here. If it's just a matter of printing the invalid glob, that should hopefully be pretty easy to do. I'll see what I can do about this before the next release.

@BurntSushi
Copy link
Owner

OK, I think this should be fixed. Here is the new output:

$ rg -g "foo" -g "bar" -g "**.txt" foobar
error parsing glob '**.txt': invalid use of **; must be one path component
$ rg -g "foo" -g "bar" -g "{{}}" foobar
error parsing glob '{{}}': nested alternate groups are not allowed

BurntSushi added a commit that referenced this issue May 11, 2017
The `ignore` and `globset` crates both got breaking changes in the
course of fixing #444, so increase 0.x to 0.(x+1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to the functionality of the software.
Projects
None yet
Development

No branches or pull requests

2 participants