format

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitOK            = 0
	ExitUsage         = 2 // client-side validation / conflicting flags
	ExitBadRequest    = 3 // server 4xx (non-429), bad REF, not found
	ExitRateLimited   = 4 // server 429
	ExitServerNetwork = 5 // 5xx, network failures, clipboard, etc.
)

Process exit codes used across all commands. See README for the contract.

Variables

This section is empty.

Functions

func ConfigureColor

func ConfigureColor(forceOff bool)

ConfigureColor disables color when not on a TTY or when forced off. NO_COLOR env var is honored automatically by fatih/color via its NoColor flag.

func HandleError

func HandleError(err error) int

HandleError maps an error to (message, exit code) following the conventions. It writes the message to stderr and returns the code; the caller should os.Exit it.

func IsStderrTTY

func IsStderrTTY() bool

IsStderrTTY reports whether stderr is connected to a terminal.

func IsStdoutTTY

func IsStdoutTTY() bool

IsStdoutTTY reports whether stdout is connected to a terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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