cli: extract option splitting and use it for --compiler (#746) #958
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thought I'd take a crack at #746 while I was dealing with
:
splitting for the formatters. The compiler isn't as easy to unit test as the formatters was since the result of the split is used internally to the config builder plus it actuallyrequire
s the module so you can't just send anything you want to it...like a windows absolute path. So I added anOptionSplitter
utility that both the--format
and--compiler
can use. There are no new tests for--compiler
because of the reason above, but the existing feature should ensure there are no regressions.The splitting itself almost turned out to be simple with negative look aheads and look behinds until I found out that js regex doesn't support look behinds. That's why there's still a little bit of logic to smash those back together.