Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: GPL-3.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIndexDebounce = 500 * time.Millisecond

DefaultIndexDebounce mirrors the watch command's default: a burst of filesystem events (an editor saving, a copy landing in chunks) is collapsed into a single re-index pass.

View Source
const ExitCodeIntegrityFailure = 4

ExitCodeIntegrityFailure is the process status `chest verify` asks for when the tree no longer matches its manifest.

The command returns an integrityError rather than calling os.Exit itself, so Execute() can map it the same way it maps thresholdError to 3. Registering it in root.go takes one branch:

if IsIntegrityFailure(err) {
	os.Exit(ExitCodeIntegrityFailure)
}

4 is distinct from every other status the CLI uses: 0 success, 1 a command that could not run, 2 unused, 3 a battery threshold that was met. A script checking a backup needs "it ran, and it failed" to be tellable apart from "it ran and found nothing wrong" — that is the whole point of the code.

Variables

View Source
var Version = "v0.8.2"

Functions

func Execute

func Execute()

Execute runs the root CLI command

func IsIntegrityFailure added in v0.8.0

func IsIntegrityFailure(err error) bool

IsIntegrityFailure reports whether err is the "the tree does not match its manifest" verdict, for callers that want to branch on it rather than on the exit status.

func RenderChestLogo() string

RenderChestLogo renders the pixel art logo followed by the ANSI prompt marker.

func Update added in v0.3.0

func Update(out, errOut io.Writer) error

Update reinstalls CHEST at the latest published version by invoking "go install" on the module's main package. While it runs, a spinner is shown on errOut; "go install"'s own output is captured and replayed once the spinner stops so the two never clobber each other on the same line.

Types

This section is empty.

Jump to

Keyboard shortcuts

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