Skip to content

fix(cli): keep a brace glob of --match in one piece - #29

Merged
dangreen merged 1 commit into
mainfrom
fix/cli-match-list
Sep 1, 2026
Merged

fix(cli): keep a brace glob of --match in one piece#29
dangreen merged 1 commit into
mainfrom
fix/cli-match-list

Conversation

@dangreen

@dangreen dangreen commented Sep 1, 2026

Copy link
Copy Markdown
Member

--match used 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:

srcset 'images/*' -d dist -m '**/*.{jpg,png}'   # -> ['**/*.{jpg', 'png}'] — nothing written, exit 0

A media query list broke the same way, turning one list (an or) into two queries joined by and:

srcset 'images/*' -d dist -m '(min-width: 3000px), (max-width: 500px)'

Both are ordinary inputs, and both failed silently — no error, no output, a zero exit code.

The fix

--match moves to the list reader added in argue-cli 3.2.0: it takes the argument as it is and collects the repeated options. --width and --format keep Array — 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:

srcset 'images/*' -d dist -m '**/*.jpg' -m '**/hero*'   # both must match

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 -m still ands, and -w 0.5,0.25 still splits. Two tests cover the brace glob and the repeated options; the cli suite is at 46.

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.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 33512035068

Coverage remained the same at 93.692%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 875
Covered Lines: 828
Line Coverage: 94.63%
Relevant Branches: 631
Covered Branches: 583
Branch Coverage: 92.39%
Branches in Coverage %: Yes
Coverage Strength: 80716.11 hits per line

💛 - Coveralls

@dangreen
dangreen merged commit 8621c57 into main Sep 1, 2026
7 checks passed
@dangreen
dangreen deleted the fix/cli-match-list branch September 1, 2026 13:14
@github-actions github-actions Bot mentioned this pull request Sep 1, 2026
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

Successfully merging this pull request may close these issues.

2 participants