Skip to content

Add --dry-run flag to put#345

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feature/put-dry-run
Jul 9, 2026
Merged

Add --dry-run flag to put#345
AndreyVMarkelov merged 1 commit into
masterfrom
feature/put-dry-run

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a --dry-run flag to dbxcli put, matching the convention used by mkdir, rm, restore, mv, and cp. Covers all three upload paths:

  • Single file: prints Would upload <src> to <dst>; resolves the destination path (reading dest metadata) so the previewed target matches a real upload.
  • Recursive directory: walks the local tree and previews every file upload plus folder creation (including empty dirs), preserving the skipped-symlink warning.
  • Stdin: prints Would upload - to <dst> without reading stdin.

JSON output reports status planned with dry_run=true in the input. Manifest, JSON contract test, and golden schema updated in lockstep; regenerated docs/schemas show no drift.

plannedPutRecursiveResults mirrors putRecursiveInternal's two-pass walk (a comment ties their traversal semantics together) but plans results instead of issuing writes.

Preview intended uploads without calling the Dropbox API across all put
paths: single file, recursive directory, and stdin. Text output prints
"Would upload <src> to <dst>" (and "Would create directory <dst>" for
folders); JSON reports status "planned" with dry_run=true in the input.

plannedPutRecursiveResults mirrors putRecursiveInternal's two-pass local
walk (files then empty dirs, preserving the skipped-symlink warning) but
plans results instead of issuing writes. Single-file dry-run still reads
destination metadata so the resolved target path matches a real upload.
@AndreyVMarkelov AndreyVMarkelov merged commit cc80d1e into master Jul 9, 2026
13 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