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

Special pattern for filename/basename? #22

Open
mitchellwrosen opened this issue Apr 8, 2017 · 0 comments
Open

Special pattern for filename/basename? #22

mitchellwrosen opened this issue Apr 8, 2017 · 0 comments

Comments

@mitchellwrosen
Copy link
Collaborator

Right now \0 refers to the entire match of the regex, which is not necessarily the entire file.

It might be nice to launch sos like so:

sos -p 'hs$' -c 'stack ghc <the-file>'

and have it run stack ghc on any modified file that ends in hs. However, I believe the simplest way to do this (currently) is:

sos -p '.*hs$' -c 'stack ghc \0'

Not too bad, but that extra .* can be annoying. Would it make sense to have magic variable names for the absolute path matched and/or the basename matched?

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

No branches or pull requests

2 participants