Repository navigation
fix(cli): --meta takes one key=value per flag; fix CLI examples (#54) - #56
Merged
Merged
Conversation
…pass directories, several files or globs (#54)
|
The changes in this PR will be included in the next version bump.
|
|
|
|
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.


Closes #54
Summary
The docs gave about 70 example commands the CLI rejects. While fixing them I found a real CLI bug that broke even more of them.
--metaswallowed the file after it. It was declared variadic (<key=value...>), so init read
README.mdas a secondkey=valuepair, then read stdin, found nothing and exited 0. Every documented--meta … FILEexample was affected, including one in the shipped Agent Skill.-m a=b c=d.parseFilterOptionsnow splits at the first=, so--meta expr=a=bkeepsa=b.FilterCliOptions.metais typedArray<string>; it was declaredRecordbut used as an array.Docs (
packages/mdcode/README.md,examples/CLI_EXAMPLES.md):list,runanddumpread one file. Their examples now passdocs/guide.mdinstead ofdocs/ordocs/*.md, and use a shell loop where several documents make sense.extract,updateandvalidatetake several files.docs/becamedocs/*.md.--filematches exactly. Glob values became exactfile=values. The "Wildcards and Patterns" section became "No Wildcards", which suggests a shared metadata value for groups. The "Test All Code Blocks" workflows now use-m kind=teston one document.--filea "pattern", and describes repeatable--meta. Changes from Earlier Versions has an entry for--meta. TheTransformerMetaJSDoc ("supports glob patterns") is corrected.The skill needed no change: it already described the real behaviour, and its
--metaexample now works. The Intent records mark the gap resolved (batch 2 inskill_spec.md) and the reviews are recorded.Evidence
mdcode list --json --meta type=example README.mdreturned"blocks":[]. Putting the file before the flag returned the block.After: both return the block.
cli-integration.test.ts: "--meta takes one key=value, so a file after it is still the file to read". It covers a file after--meta, repeated-mcombined with AND, and a value with=. It failed on the variadic build ("doc.md must be read, not taken as a second key=value") and passes now.mdcode …line, now finds nolist/run/dumpwith several files or a directory, and no glob--filevalue. The only hits left are shellforloops.list,update,validate --for extract,extract,runanddumpwith--meta kind=keep doc.mdand checks each selects only thekeepblock. It fails on main'scli.ts(list must read doc.md after --meta) and passes now.pnpm exec intent maintainer check --base origin/main: 0 pending.pnpm checkpasses (pre-push).Merge Danger
Door: two-way
Blast Radius: CLI flags
-m a=b c=d, several pairs after one flag, no longer works. Write-m a=b -m c=dinstead. No docs or tests used that form, and it's in the changelog. The bump is a patch: the old form silently swallowed file arguments, so this is a bug fix.