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

Commands with quotes fail to parse #30

Open
michalrus opened this issue Dec 29, 2017 · 3 comments
Open

Commands with quotes fail to parse #30

michalrus opened this issue Dec 29, 2017 · 3 comments

Comments

@michalrus
Copy link

On 85d4008, e.g.:

$ echo "cabal test --test-options='1234'\\'' 567'"
cabal test --test-options='1234'\'' 567'

$ sos . -c "cabal test --test-options='1234'\\'' 567'"
sos: Error parsing command 'cabal test --test-options='1234'\'' 567''

(1)$ 
@schell
Copy link
Owner

schell commented Dec 29, 2017

@michalrus what's the use case here?

@michalrus
Copy link
Author

@schell, say, if I wanted to match a Tasty test case with a space in name, I’d need that. The pure Cabal command would then be:

cabal test --test-options='-p '\''some test name w/ spaces'\'' --color=always'

Currently there’s no way to pass that command to sos -c [ … here … ].

@schell
Copy link
Owner

schell commented Jan 4, 2018

Yes, I see. The difficulty here is that within a command we use \ as the leader to a capture group. It's possible we simply need some logic around that to check for quotes, as that is obviously not a valid capture group.

I'll get this when I can but until then I welcome any pull request, @michalrus! Here's where the logic should probably go:
https://github.com/schell/steeloverseer/blob/master/src/Sos/Template.hs#L41

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