Repository navigation
v2.2.3
Date: 2026-03-27
Previous release: v2.2.2
Summary
This release standardizes client command output behind a shared --format flag (text, json, table) and stable JSON DTOs, separates scan/record progress (stderr) from the final summary (stdout), migrates SunSpec off standalone --json to --format json, and improves shell completion for enum-like flags via a small generic helper in internal/cli.
Highlights
- Client output layer: Results for identify, reportserverid, read, fingerprint, diagnostic, scan, record, and client sunspec are produced through
internal/format(format.Write) with typed payloads ininternal/types(*_output.go).internal/modbuscollects data and performs MCAP side effects; it does not print final user-facing results to stdout. --formatand env:MODBUSCTL_OUTPUT_FORMAT/--formaton client commands accept text (default), json, or table. This is distinct frommcap convert, which still uses--format csv|jsonandMODBUSCTL_FORMAT.- JSON contract: Field naming conventions for scripts are documented in
docs/json-output.md;--format jsonis treated as a stable scripting surface (discipline in release notes for intentional changes). - Scan / record: Live progress, debug lines, and worst-case hints go to stderr only; stdout emits one formatted summary after the run—important for
--format jsonpipelines. - SunSpec: Subcommands use the same
--formatmechanism. A hidden parent--jsonremains as a deprecated alias mapping to--format json. - Shell completion: Generic
cli.RegisterEnumFlagCompletion/RegisterEnumFlagCompletionWithDescriptions; canonical value lists live with their domains (e.g.format.Values()for client stdout formats,config.ScanAlgorithms(),ConvertFormats(), etc.).--formatis registered next to flags on each command (no deferred command-tree walk). - Tests: Golden-style checks for representative text output and JSON structure; config/format completion maps stay aligned with allowed values via small tests.
Upgrading
- Scripts parsing client stdout: Prefer
--format jsonand the documented JSON fields; default text output is intended to stay close to prior UX where practical. - SunSpec: Replace
--jsonwith--format json; stop relying onMODBUSCTL_JSON(removed in favor ofMODBUSCTL_OUTPUT_FORMAT). - Scan/record automation: If you previously assumed progress on stdout, capture stderr for logs and stdout for the final summary (or use
--format jsonon stdout only). - Completion users: Regenerate and re-source your shell completion script after upgrading so new
--formatcandidates and descriptions are picked up.
Release workflow
- Unchanged from v2.2.2: reusable
go-binary-releaseworkflow and link-time version metadata.