fix(cli): accept positional image path for send#41
Merged
ShunmeiCho merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
Windows smoke testing showed users can reasonably expect cc-clip send --paste C:\test.png to upload that file, but the previous parser left the path in fs.Args() and silently read the clipboard instead. This makes one positional image path an explicit --file equivalent while preserving host-first/default-host forms and rejecting trailing flags after positionals. Constraint: Go flag package stops at first positional arg, so parser has to normalize leading and trailing positionals before upload Rejected: Error on all unexpected positionals | would preserve the reporter's confusing failure mode instead of supporting the intuitive path form Confidence: high Scope-risk: narrow Directive: Keep send parser tests covering default-host, host-first, post-flag, and conflict forms before changing CLI grammar Tested: go test ./... -count=1; go vet ./...; go run ./cmd/cc-clip --help; env GOOS=windows GOARCH=amd64 go test -c ./cmd/cc-clip -o /tmp/cc-clip-windows.test.exe Not-tested: Real Windows clipboard paste against a remote host
9 tasks
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
Context
Follow-up to the #30 Windows smoke-test feedback where cc-clip send --paste C:\test.png appeared to work. The old parser left that path in fs.Args() and silently read the clipboard instead.
Tests
Not tested: real Windows clipboard paste against a remote host.