Skip to content

v2.2.3

Choose a tag to compare

@github-actions github-actions released this 27 Mar 14:42

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 in internal/types (*_output.go). internal/modbus collects data and performs MCAP side effects; it does not print final user-facing results to stdout.
  • --format and env: MODBUSCTL_OUTPUT_FORMAT / --format on client commands accept text (default), json, or table. This is distinct from mcap convert, which still uses --format csv|json and MODBUSCTL_FORMAT.
  • JSON contract: Field naming conventions for scripts are documented in docs/json-output.md; --format json is 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 json pipelines.
  • SunSpec: Subcommands use the same --format mechanism. A hidden parent --json remains 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.). --format is 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 json and the documented JSON fields; default text output is intended to stay close to prior UX where practical.
  • SunSpec: Replace --json with --format json; stop relying on MODBUSCTL_JSON (removed in favor of MODBUSCTL_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 json on stdout only).
  • Completion users: Regenerate and re-source your shell completion script after upgrading so new --format candidates and descriptions are picked up.

Release workflow

  • Unchanged from v2.2.2: reusable go-binary-release workflow and link-time version metadata.