fix: pass dash-looking operands after -- - #256
Merged
Merged
Conversation
Clap treats a positional --apply as the apply flag. Replace, search, and doc Quick Actions then fail with "cannot be used multiple times" or unexpected argument. Put options first, then --, then operands. serializePatchloomArgs inserts --apply before --. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
SebTardif
marked this pull request as ready for review
August 28, 2026 21:01
SebTardif
added a commit
that referenced
this pull request
Aug 28, 2026
* fix: put remaining Quick Action paths after -- Create, append, prepend, tidy, apply-fragment, md, patch, and doc merge still put the file path before options. A path of --apply made clap treat it as the apply flag. Same -- terminator as #256. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca> * fix: pass Quick Action option values as --flag=value Clap treats a following `--` or `-n` as end-of-options or another flag, so create/replace content starting with a dash failed. Bind user option values with equals form. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca> --------- Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
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.
Summary
Stop clap from treating Quick Action operands such as
--applyas flags.Why
After #255, the extension no longer scans argv for flag names. The Patchloom CLI still does. A replace of the text
--applywas serialized as:patchloom --contain replace --apply --new X file --applyLive probe on
patchloom 0.28.0:the argument '--apply' cannot be used multiple times. Search with pattern--applyfailed withunexpected argument '--apply'. Doc set with selector--applyfailed the same way.Clap's own hint is: pass
-- --applyas a value.The change
withEndOfOptions(head, operands)emits options, then--, then positionals.serializePatchloomArgsinserts--applybefore--so the apply flag is not swallowed as a path.Working form (live-probed):
patchloom --contain replace --new X --apply -- --apply fileVerification
patchloomprobe: old argv fails;--form replaces--applyand--containin file text.npm test430 passed, 7 skipped.vsce packagepassed.Checklist
git commit -snpm run checkand it passes