Repository navigation
feat: aligned version output and full shell completion - #20
Merged
Merged
Conversation
version prints one line (name, version without v, tag, full commit, build date, Go version, platform), or one JSON object with --json or --format json. Missing values come from runtime/debug build info (commit with -dirty) or are dev/unknown; internal/buildinfo replaces versionOf. The release workflow's -X main.* ldflags are unchanged; the Makefile now injects the full commit. completion covers bash, zsh, fish and PowerShell. EDS arguments, adapter --config and the --output of eds generate/codegen complete files of their type; every other value flag and argument completes nothing instead of file names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
version lists the github.com/otfabric/go-* modules of the build after the build date (text) and as libraries (JSON). A pseudo-version or +dirty version from the build info is dev. make build injects a version and tag only when HEAD is exactly on a tag. 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>
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>), the OT Fabric libraries of the build (go-ethernetip) after the build date. No leadingv; the tag part is left out when there is no tag; 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.go install …@vX.Y.Zreports that version.version --json, andversionwith the global--format json/ETHERNETIPCTL_FORMAT=json:{"name","version","tag","commit","built","libraries","go","platform"}(libraries:[{"name","version"}]) in that order, every key present.--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). Existing enum completion of--format,--type(read/write/tag write),reset --typekept. New:eds inspect|validate|codegen <file>complete.eds;eds generate --output.eds;eds codegen --output.go;adapter --configyaml|yml|json. Every other value flag (hosts, addresses, numbers, durations,forward-open --configassembly instance) and every host/path argument usesNoFileComp.docs/commands.md(version flag and output),docs/json-output.md, README (completion sentence, command table), RELEASE.md v0.6.0.Before / after
Before:
After (release ldflags; then plain
go build):Tests
internal/buildinfo: all fields, no tag, dev fallback, pseudo-version/+dirty-> dev, libraries (zero, one, two; replace and nested modules), embedded build info (-dirty), JSON key order.internal/cli:CompleteTreeunit test.cmd: version text /--json/--format json|table/ETHERNETIPCTL_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(fmt, staticcheck, golangci-lint, vet, 32-bit cross build, govulncheck,-racetests, coverage 95.9%, per-package coverage, docsync) andmake e2egreen locally.🤖 Generated with Claude Code