Skip to content

Add --output=json support to rm command#264

Merged
AndreyVMarkelov merged 2 commits into
output-format-flagfrom
rm-json-output
Jun 22, 2026
Merged

Add --output=json support to rm command#264
AndreyVMarkelov merged 2 commits into
output-format-flagfrom
rm-json-output

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • First command to use enableStructuredOutput from Add --output flag with JSON structured output infrastructure #263
  • In JSON mode, rm emits a {"results": [...]} envelope with input flags and file/folder metadata for each deleted target
  • Reuses shared jsonMetadata struct for consistent serialization across commands
  • Text mode behavior unchanged (prints "Deleted ..." only when --verbose is set)

Test plan

  • go vet ./... clean
  • golangci-lint run ./... clean
  • All tests pass (go test ./... -count=1)
  • Manual: dbxcli rm --output=json /test-file.txt emits JSON result
  • Manual: dbxcli rm --output=json --permanent /test-file.txt shows "permanent":true
  • Manual: dbxcli rm /test-file.txt (text mode) unchanged behavior

AndreyVMarkelov and others added 2 commits June 22, 2026 10:10
Add --output flag with JSON structured output infrastructure
First command to use enableStructuredOutput. In JSON mode, rm emits a
results array with input flags and file/folder metadata for each deleted
target. Reuses shared jsonMetadata for consistent serialization.
@AndreyVMarkelov AndreyVMarkelov merged commit dccb16a into output-format-flag Jun 22, 2026
2 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