cmdversion

package
v0.216.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmdversion renders version metadata supplied by the build domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(snapshot func() buildinfo.Report) *cobra.Command

New creates an independent version command with a lazy snapshot operation.

func NewWithStale

func NewWithStale(snapshot func() buildinfo.Report, scan func(context.Context, string) []stalewb.Binary) *cobra.Command

NewWithStale is New plus a scan for older wb copies on PATH. scan receives the running version; nil skips it.

func Write

func Write(out io.Writer, info buildinfo.Report, asJSON bool) error

Write preserves the successful output contract and returns writer failures.

func WriteBare

func WriteBare(out io.Writer, version string) error

WriteBare emits only the version for root-level pre-Cobra requests.

func WriteWithStale

func WriteWithStale(out, warn io.Writer, info buildinfo.Report, stale []stalewb.Binary, asJSON bool) error

WriteWithStale writes the version document. Stale wb copies are a field of the JSON document and a warning on warn after the human text.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL