headless

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHeadless

func IsHeadless() bool

IsHeadless returns true if not running in an interactive terminal

func SetHeadlessForTesting

func SetHeadlessForTesting(headless bool) func()

SetHeadlessForTesting overrides IsHeadless for testing purposes. Returns a cleanup function that restores the original behavior.

func Validate

func Validate(requirements ...Requirement) error

Validate checks all requirements, but only if in headless mode. In interactive mode, returns nil (TUI will handle missing values).

Types

type Flag

type Flag struct {
	Name      string // Flag name for error messages (e.g., "blueprint-file")
	Value     string // Current value
	IsDefault bool   // True if using default value (not explicitly set)
}

Flag represents a flag value with its default status

type Requirement

type Requirement interface {
	Validate() error
}

Requirement defines a validation rule

func OneOf

func OneOf(flags ...Flag) Requirement

OneOf creates a rule that at least one of the flags must be provided

func Required

func Required(f Flag) Requirement

Required creates a rule that the flag must be explicitly provided

Jump to

Keyboard shortcuts

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