fix(sandbox): parse sync flags placed after the sandbox arg#60
Merged
Conversation
urfave/cli v2 stops flag parsing at the first positional, so `sandbox sync my-box --mode mirror` silently dropped every flag after the sandbox argument — the new --exclude/--mode/--quiet/--no-ignore-vcs plus the pre-existing --local/--remote/-i (the latter masked by the interactive prompts on a TTY). - add syncOptions + parseSyncArgs to recover flags regardless of position, matching the parseDiskCreateArgs / splitForceFlag pattern - extract pure mutagenCreateArgs so the destructive mirror mapping is unit-tested - make runMutagen take output sinks; --quiet now captures sync create output and surfaces it only on failure instead of leaking to stderr - add regression tests for the parser, mirror mapping, and mode mapping Addresses review feedback on #59.
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.
Recovers a dropped fix
PR #59 was squash-merged while GitHub's PR API still pointed at the stale head
c7edb2d, so the follow-up fix commit0247f9enever landed on main. This re-applies it.What
urfave/cli v2 stops flag parsing at the first positional, so
sandbox sync my-box --mode mirrorsilently dropped every flag after the sandbox argument (the new --exclude/--mode/--quiet/--no-ignore-vcs plus the pre-existing --local/--remote/-i, the latter masked by interactive prompts on a TTY).syncOptions+parseSyncArgsrecover flags regardless of position (matchesparseDiskCreateArgs/splitForceFlag)mutagenCreateArgsso the destructivemirrormapping is unit-testedrunMutagentakes output sinks;--quietcaptures create output, surfaces it only on failureVerify
go build / go test (6 pass) / golangci-lint v2 (0) / gosec (0). Verified on the real binary: flags after the positional now parse end-to-end.