Skip to content

Add --dry-run flag to share-link update#347

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

Add --dry-run flag to share-link update#347
AndreyVMarkelov merged 1 commit into
masterfrom
feature/share-link-update-dry-run

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a --dry-run flag to dbxcli share-link update, matching the convention used by mkdir, rm, restore, mv, cp, put, and share-link revoke.

  • Text: prints Would update shared link <url> without calling the Dropbox API.
  • JSON: reports status planned with dry_run=true in the input.

The dry-run branch runs after URL validation and flag parsing, so conflicting flags (--expires + --remove-expiration), invalid audience, and empty URL still error correctly during a preview.

The planned result reports a synthetic link kind with just the URL, since no metadata is fetched (a real update returns the actual file/folder kind). Adds shareLinkJSONKindLink for that kind and shareLinkUpdateResultInput to carry dry_run in the per-result input, which was previously empty for this command. Manifest, JSON contract test, and golden schema updated in lockstep; regenerated docs/schemas show no drift.

Testing

  • go build ./..., go vet ./cmd/, gofmt clean
  • go test ./... passes
  • New tests cover text and JSON dry-run, both asserting ModifySharedLinkSettings, ModifySharedLinkSettingsRaw, and GetSharedLinkMetadata are never called during dry-run.

Preview shared-link setting changes without calling the Dropbox API.
Text output prints "Would update shared link <url>"; JSON reports status
"planned" with dry_run=true in the input. The dry-run branch runs after
URL and flag validation, so conflicting flags and bad input still error.

The planned result reports a synthetic "link" kind with just the URL,
since no metadata is fetched. Adds shareLinkJSONKindLink for that kind
and shareLinkUpdateResultInput to carry dry_run in the per-result input,
which was previously empty for this command.
@AndreyVMarkelov AndreyVMarkelov merged commit 8514319 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