Skip to content

Add --output=json support to put command#276

Merged
AndreyVMarkelov merged 2 commits into
masterfrom
put-json-output
Jun 24, 2026
Merged

Add --output=json support to put command#276
AndreyVMarkelov merged 2 commits into
masterfrom
put-json-output

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Refactors put command to support structured JSON output via --output=json
  • Upload functions (uploadSingleShot, uploadChunked) now return *files.FileMetadata for result reporting
  • Adds putResult with status tracking (uploaded, skipped, created, existing) and kind (file, folder)
  • Recursive directory handling reports per-file/folder results in a single JSON array
  • Stdin uploads hide internal temp spool paths from JSON output
  • Adds nil checks in jsonMetadataFromDropbox for typed nil interfaces
  • Updates README with put JSON example and migrated command list

Test plan

  • All existing tests pass
  • New JSON tests: single file upload, default target, if-exists skip/fail, stdin (verifies temp path not leaked), recursive with directories and files, text mode silent
  • gofmt, go vet, golangci-lint clean

AndreyVMarkelov and others added 2 commits June 23, 2026 22:16
Add --output=json support to cp and mv commands
Refactor put command to support structured JSON output for scripting.
Upload functions now return metadata for result reporting. Adds putResult
with status tracking (uploaded/skipped/created/existing) and recursive
directory handling with per-file results.
@AndreyVMarkelov AndreyVMarkelov merged commit bf2fc6e into master Jun 24, 2026
7 checks passed
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.

1 participant