cmd

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 41 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitCode added in v0.1.5

func ExitCode(err error) int

ExitCode is the process exit code for the error a command returned: 0 for none, the code of an exitError, else 1.

func NewRoot

func NewRoot(build BuildInfo, features Features) *cobra.Command

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

BuildInfo says which build of the CLI this is; the release build fills it in through linker flags.

func (BuildInfo) String

func (b BuildInfo) String() string

String is the version line: "0.1.0 (commit 1a2b3c4, built 2026-10-09T12:42:20Z)", leaving out what is unknown.

func (BuildInfo) WithRuntime

func (b BuildInfo) WithRuntime(bi *debug.BuildInfo, ok bool) BuildInfo

WithRuntime fills what the linker flags left unset from the build info embedded by the Go toolchain, so a binary from `go install` or `go build` inside a checkout still knows its module version and commit.

type Features

type Features struct {
	// Experimental enables the commands that are not ready for everyone: install and upgrade.
	Experimental bool
}

Features say which parts of the CLI are available.

func FeaturesFromEnv

func FeaturesFromEnv(getenv func(string) string) Features

FeaturesFromEnv reads the features from the environment; KUBRIX_EXPERIMENTAL=1 (or true, yes, on) enables the experimental ones.

Jump to

Keyboard shortcuts

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