root

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package root defines the root configuration for the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Stdin      io.Reader
	Stdout     io.Writer
	Stderr     io.Writer
	NoFix      bool
	FmtOnly    bool
	NewFromRev string
	Flags      *ff.FlagSet
	Command    *ff.Command
}

Config holds shared I/O writers, shared flags, and the root ff.Command. All subcommand configs embed *Config to inherit these.

func New

func New(stdin io.Reader, stdout, stderr io.Writer) *Config

New wires I/O into the root config and registers the shared --no-fix, --fmt-only, and --new-from-rev flags inherited by all subcommands.

type ExitError

type ExitError int

ExitError is returned by commands that want a specific non-zero exit code without printing an additional error message. run() in main.go checks for ExitError with errors.As and calls os.Exit(int(e)) directly, bypassing the default "error: ..." printer.

func (ExitError) Error

func (e ExitError) Error() string

Jump to

Keyboard shortcuts

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