Skip to content

Add --output=json support to search command#271

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
search-json-output
Jun 22, 2026
Merged

Add --output=json support to search command#271
AndreyVMarkelov merged 1 commit into
masterfrom
search-json-output

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Migrate search to emit structured JSON with {"input": {...}, "entries": [...]} when --output=json is used
  • Add shared jsonMetadataListFromDropbox helper in cmd/json_metadata.go for converting metadata slices
  • searchInput includes query, optional path scope, and display options (long, sort, reverse, time, time_format)
  • Path field uses omitempty — omitted when searching without a scope

Test plan

  • go vet ./... clean
  • golangci-lint run ./... clean
  • All tests pass (go test ./... -count=1)
  • Manual: dbxcli search --output=json report emits JSON entries
  • Manual: dbxcli search --output=json report /docs includes path scope in input
  • Manual: dbxcli search report text output unchanged

Emit search results as structured JSON with input query/scope and
entries array. Add shared jsonMetadataListFromDropbox helper for
converting metadata slices.
@AndreyVMarkelov AndreyVMarkelov merged commit a237a83 into master Jun 22, 2026
6 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