cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package cli is the command line, per doc/cli.md.

It decides nothing about layout or rendering: every flag maps to a library option, every diagnostic comes from the engine or the renderer. What lives here is argument parsing, the choice of output format, the two reports -- a template check and a printout dump -- and the exit code.

Run takes its streams as arguments so that a test drives a whole command the way a shell does.

Index

Constants

View Source
const (
	// ExitOK is success. Warnings do not change it.
	ExitOK = 0
	// ExitFail is a run that did not produce its document.
	ExitFail = 1
	// ExitUsage is a mistake in the command line.
	ExitUsage = 2
)

Exit codes, as doc/cli.md specifies them.

Variables

This section is empty.

Functions

func Run

func Run(env Env) int

Run executes one command line and returns the exit code.

Types

type Env

type Env struct {
	// Args are the arguments after the program name.
	Args []string
	In   io.Reader
	Out  io.Writer
	Err  io.Writer
}

Env is the process one run reads and writes.

Jump to

Keyboard shortcuts

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