Repository navigation
feat: aligned version output and full shell completion - #25
Merged
Merged
Conversation
version prints one line (name, version without v, tag, full commit, build date, the go-profinet version, Go version, platform), or one JSON object with --json or --format/-o json. Missing values come from runtime/debug build info (commit with -dirty; pseudo-versions are dev) or are dev/unknown; internal/buildinfo replaces versionOf. The release workflow's -X main.* ldflags are unchanged; the Makefile injects the full commit, and a version and tag only when HEAD is on a tag. completion covers bash, zsh, fish and PowerShell. --mrp-role and im read --record complete their values next to --format, --mode and --interface; GSDML, GSDX, model, expected-link and pcap files complete by type, and every other value flag and argument completes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test binaries of Go 1.26 carry no module dependencies in their build info, so the unit test no longer requires the library there; the e2e suite checks it on the built binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
version: one line on stdout,<name> <version> (tag <tag>, commit <commit>, built <built>, <libraries>, <go>, <goos>/<goarch>). No leadingv; the tag part is left out when there is no tag; the OT Fabric libraries of the build (go-profinet) follow the build date, as the oldgo-profinet:line did. A development build reportsdev(also for pseudo-versions and+dirty), the full commit fromruntime/debugbuild info (-dirtywhen modified; was the 7-character short SHA) andbuilt unknown.version --json, andversionwith the global--format json/-o json/PROFINETCTL_FORMAT=json:{"name","version","tag","commit","built","libraries","go","platform"}in that order,librariesas[{"name","version"}].--format text|tableprints the line.internal/buildinfo(replacesversionOf);main.version/tag/commit/buildDatestay the ldflags targets, so the release workflow'sldflagsis unchanged. Makefile: full commit SHA; VERSION/TAG only when HEAD is exactly on a tag (elsedev).__complete). New value completion:--mrp-role(client, manager, off) andim read --record(0-4), next to the existing--format,--mode,--interface. Files by type: GSDML arguments ofgsdml inspect|validate|check|modules|submodulesand--gsdml(xml),gsdml gsdx(gsdx),--model/--expect(json),--pcap(pcap);--data-file,--output-fileany file. Every other value flag and argument (stations, MACs, addresses, numbers, durations) usesNoFileComp.docs/json-output.md,docs/EXAMPLES.md(version block; derived, not regenerated —make examples-docneeds Docker and p-net), README (completion sentence, command table), RELEASE.md v0.9.0.Before / after
Before:
After (release ldflags; then plain
go build):Tests
internal/buildinfo: all fields, no tag, dev fallback, pseudo-version/+dirty→ dev, embedded build info (-dirty), libraries (zero, one, two; from build info with replace and nested modules), JSON key order.cmd: version text /--json/-o json/--format table/PROFINETCTL_FORMAT=json/ dev build;__completefor the four shells, enum flags, file and free-value directives; a walk over every command that fails when a value flag has no completion or a flag whose usage lists values does not complete them.make check(release-notes-check, fmt, staticcheck, golangci-lint, vet, 32-bit cross build, govulncheck,-racetests, coverage 93.2%, per-package coverage, docsync) andmake e2egreen locally.🤖 Generated with Claude Code