cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package cli wires the demografix command tree and owns process exit codes and user-facing error rendering.

Index

Constants

View Source
const (
	ExitOK         = 0
	ExitGeneric    = 1
	ExitUsage      = 2
	ExitAuth       = 3
	ExitSubscript  = 4
	ExitValidation = 5
	ExitRateLimit  = 6
	ExitTransport  = 7
)

Exit codes. These are part of the CLI contract.

Variables

This section is empty.

Functions

func Code

func Code(err error) int

Code maps an error to a process exit code.

func Execute

func Execute() int

Execute runs the CLI and returns a process exit code. SIGINT/SIGTERM cancel the command context so a long enrich run can flush partial output.

func Render

func Render(w io.Writer, err error)

Render writes a friendly one-line error to w.

func UsageErrorf

func UsageErrorf(format string, a ...any) error

UsageErrorf builds a usage error.

Types

type App

type App struct {
	Out io.Writer
	Err io.Writer
	In  *os.File
	// contains filtered or unexported fields
}

App holds global flags and IO. It is the receiver for every command.

Jump to

Keyboard shortcuts

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