-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow multiple PATTERNs #11
Comments
Agreed, makes sense (and would bring |
Now that #16 is done, implementing the semantics of this is trivial. However, the syntax problem remains: how to make it non-ambiguous and user-friendly? The main problem being that if one can provide multiple patterns and multiple files, it's not clear where the former stop and the latter begin. (I've considered the possibility of testing for file existence to decide, but I fear that would be too smart not to be surprising, and can possibly backfire in weird cases.) For reference,
That would work for |
One option would be to require one argument, so you'd have to quote it, e.g.
|
That wouldn't work, because the last resort of pattern inference is Yesterday, however, I've tried in practice the grep approach (patterns are newline-separated) and it is not that bad to type using double quotes as in your example:
because shells (I've tried both bash and zsh) does not complain when they see a newline after a non-closed quoted string. So the above appears to be a viable option, what do you think? |
I guess, yes. I'm not really the best person to ask, though. |
nothing else is actually implemented... Related #11
nothing else is actually implemented... Related #11
|
You're confusing multiple OR-ed patterns (which are not needed due to regex semantics) with multiple AND-ed patterns.
This issue is about the latter, which grep does support separated by newlines. See the citation from the grep manpage earlier in this issue.
|
Since you figure out PATTERN by certain characters (e.g.
#
for tag), it would be possible to specify multiple PATTERNs.e.g.
bean-grep 2024-05-01 "#foo" books/2024
The text was updated successfully, but these errors were encountered: