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: 0

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