cli

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCliError

func HandleCliError(err error)

HandleCliError will log and exit the program appropriately based on the error. It will skip if the error is nil. It takes a verbose flag for logging the entire error chain or just the root cause.

func PromptForBool

func PromptForBool(promptMsg string) (bool, error)

func PromptForInt

func PromptForInt(promptMsg string, placeHolder string, required bool) (int, error)

func PromptForJson

func PromptForJson(promptMsg string, placeholder string, required bool) (string, error)

func PromptForOption

func PromptForOption[T comparable](promptMsg string, options []huh.Option[T], required bool) (T, error)

func PromptForOptions

func PromptForOptions[T comparable](promptMsg string, options []huh.Option[T], min int, limit int) ([]T, error)

func PromptForString

func PromptForString(promptMsg string, placeHolder string, required bool) (string, error)

func PromptForUrl

func PromptForUrl(promptMsg string, placeHolder string, withTrailingSlash bool) (string, error)

func ValidateEmptyString

func ValidateEmptyString(s string) error

func ValidateJson

func ValidateJson(s string, allowEmpty bool) error

ValidateJson validates if unmarshaling the text into JSON causes en error. It also takes a param to allow for empty text to pass, making it optional.

func ValidateStruct

func ValidateStruct(s any) error

ValidateStruct validates a struct using the validator package

func ValidateUrl

func ValidateUrl(s string) error

func ValidateVar

func ValidateVar(field any, tag string) error

ValidateVar validates a single variable using the validator package

Types

type Target

type Target struct {
	Flow *app.Flow
	Step *app.Step // nil means "run entire flow"
}

Target represents a user-specified target: either a whole flow or a specific step.

func FlattenTargets

func FlattenTargets(targets []Target, skips map[string]bool) []Target

flattenTargets expands targets into individual targets, excluding skipped ones.

func ParseTarget

func ParseTarget(cfg *config.Cfg, arg string) (Target, error)

ParseTarget parses a single target string like "flow" or "flow/step".

func ParseTargets

func ParseTargets(cfg *config.Cfg, args []string) ([]Target, error)

ParseTargets converts CLI args into Target structs. Empty args means "run all flows".

Jump to

Keyboard shortcuts

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