fix(cli): keep a brace glob of --match in one piece - #29
Merged
Conversation
The option reader split every value by commas, so `-m "**/*.{jpg,png}"`
became two patterns that both had to match: nothing matched, and the run
wrote nothing while exiting 0. A comma separated media query list broke
the same way, into two queries joined by and instead of one list.
`--match` now takes the argument as it is and collects the repeated
options, so several patterns are passed as repeated `-m`. `--width` and `--format` keep the comma form.
Coverage Report for CI Build 33512035068Coverage remained the same at 93.692%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
--matchused the comma splitting option reader, so any pattern carrying a comma of its own was torn apart — and since several match values are joined by and, the pieces could never all match:A media query list broke the same way, turning one list (an or) into two queries joined by and:
Both are ordinary inputs, and both failed silently — no error, no output, a zero exit code.
The fix
--matchmoves to the list reader added in argue-cli 3.2.0: it takes the argument as it is and collects the repeated options.--widthand--formatkeepArray— commas are unambiguous in a number or a format name.So several patterns are now passed as repeated options, and the usage line says so:
The first version of this fix re-joined what the reader had split and re-split it counting brace depth. It is dropped: it could not tell a media query list from two patterns, since that comma sits at brace depth 0.
Verified against the published argue-cli 3.2.0 — the brace glob matches both files, the media query list matches as an or, repeated
-mstill ands, and-w 0.5,0.25still splits. Two tests cover the brace glob and the repeated options; the cli suite is at 46.