Skip to content

feat: add --json output to netwp events - #85

Merged
gsjonio merged 1 commit into
developfrom
feature/events-json
Jul 18, 2026
Merged

feat: add --json output to netwp events#85
gsjonio merged 1 commit into
developfrom
feature/events-json

Conversation

@gsjonio

@gsjonio gsjonio commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What and why

netwp events was text-only, unlike scan/doctor/ports/speedtest. This adds --json so the join/leave history is scriptable.

  • Prints the []eventlog.Entry as a JSON array; eventlog.Entry already carries JSON tags (kind/ip/mac/name/at), so no separate DTO.
  • An empty history emits [], never null (eventsForJSON guards the nil slice), so the output is always valid JSON.
  • Works with --device too.

Closes #71

Risks

None. Additive read-only flag; the default text output is unchanged.

Checklist

  • Build, vet/lint, and tests pass
  • New non-trivial logic has a test (TestEventsForJSON)
  • Conventional Commits, no Claude co-author trailer
  • README.md and README.pt-BR.md updated in this PR
  • Issue has a milestone (v1.21.0)

events was text-only, unlike scan/doctor/ports/speedtest. Add --json so the
event history is scriptable: it prints the []eventlog.Entry as a JSON array
(the Entry type already carries JSON tags, so no separate DTO). An empty history
emits [] rather than null, via eventsForJSON, so the output is always valid JSON.

Closes #71
@gsjonio
gsjonio merged commit 09ab14e into develop Jul 18, 2026
9 checks passed
@gsjonio
gsjonio deleted the feature/events-json branch July 18, 2026 04:35
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.

Add --json output to netwp events

1 participant