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

Consider changing multiple regex/globs to represent OR, not AND #35

Open
cespare opened this issue Oct 15, 2016 · 5 comments
Open

Consider changing multiple regex/globs to represent OR, not AND #35

cespare opened this issue Oct 15, 2016 · 5 comments

Comments

@cespare
Copy link
Owner

cespare commented Oct 15, 2016

@mikejquinn asks why, for example, -g '*.txt' -g '*.go' uses a conjunction, rather than disjunction.

I can't remember why I did it this way. On the surface using OR seems obviously more useful. Think through the implications and consider switching.

@ivanov
Copy link

ivanov commented Dec 13, 2016

I just bumped into the same issue - not sure why you'd want a conjuction instead of a disjunction, I was expecting the latter.

For anyone who comes across this, the simple workaround I used in the meantime, without making any changes to the reflex code, was just to use the -r '.(txt|go)' instead of the -g equivalent.

@ivanov
Copy link

ivanov commented Dec 13, 2016

I should have started my comment with this: Thank you @cespare for making this package! A long time ago, I used to use the inotify facilities (inotifywatch and inotifywait) on linux for this, but those aren't available in OS X. There is an OS X work-alike using the BSD kqueue facilities - kqwait, but that only worked on the fruity machines... And fswatch which is cross-platform just feels too heavy. The same with the python-based watchdog/watchmedo. Reflex is refreshingly simple, yet sufficiently powerful. I am delighted by the lack of dependencies outside of golang standard library.

@azer
Copy link

azer commented Jun 17, 2018

I'm also experiencing a similar issue. I want to use reflex but can not select multiple file kinds.

@cespare
Copy link
Owner Author

cespare commented Jun 17, 2018

@azer selecting multiple file types is certainly possible, if not super convenient. Example:

reflex -r '(.c$)|(.h$)' echo {}

@itsdonnix
Copy link

Thanks @cespare !

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

4 participants