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

cli

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package cli implements argument parsing and terminal presentation. It does not own process signals or terminate the process.

Index

Constants

View Source
const (
	ExitOK           = 0
	ExitValidation   = 1
	ExitOperational  = 2
	ExitPresentation = 3
	ExitInterrupted  = 130
)

Process exit codes. Signals other than SIGINT map to 128+signal number.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, rt app.Runtime, args []string) (code int)

Run returns a process exit code. Help/version paths never load configuration or construct application/storage resources. rt.Log is replaced by the logger selected with --log-level/--log-format, which always writes to rt.Stderr.

Types

type Interrupted

type Interrupted struct{ Signal os.Signal }

Interrupted is the cancellation cause main records when a signal arrives.

func (Interrupted) Error

func (i Interrupted) Error() string

func (Interrupted) ExitCode

func (i Interrupted) ExitCode() int

ExitCode follows the shell convention of 128 plus the signal number.

Jump to

Keyboard shortcuts

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