pui

package module
v0.0.0-...-fd6dc78 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrActionCancelled = ActionCancelledErr{}
View Source
var ErrNoSelection = NoSelectionErr{}

Functions

func Confirm

func Confirm(opts ...Option) (bool, error)

func ConfirmSelections

func ConfirmSelections(sels []string, opts ...Option) (bool, error)

func MultiSelect

func MultiSelect(choices []string, opts ...Option) ([]string, error)

func Select

func Select(choices []string, opts ...Option) ([]string, error)

func WrapFormString

func WrapFormString(val string) (func() string, any)

Types

type ActionCancelledErr

type ActionCancelledErr struct{}

func (ActionCancelledErr) Error

func (a ActionCancelledErr) Error() string

type ConfirmField

type ConfirmField struct {
	Value bool
	// contains filtered or unexported fields
}

func NewConfirmField

func NewConfirmField() *ConfirmField

type Form

type Form struct {
	// contains filtered or unexported fields
}

func NewForm

func NewForm(opts ...Option) *Form

func (*Form) Confirm

func (f *Form) Confirm(opts ...Option) (bool, error)

func (*Form) ConfirmSelections

func (f *Form) ConfirmSelections(sels []string, opts ...Option) (bool, error)

func (*Form) Select

func (f *Form) Select(choices []string, opts ...Option) ([]string, error)

type NoSelectionErr

type NoSelectionErr struct{}

func (NoSelectionErr) Error

func (a NoSelectionErr) Error() string

type Option

type Option func(f *Form)

func WithConfirmDesc

func WithConfirmDesc(desc string) Option

func WithConfirmDescFunc

func WithConfirmDescFunc(desc func() string) Option

func WithConfirmTitle

func WithConfirmTitle(title string) Option

func WithOptions

func WithOptions(opts ...string) Option

func WithSelectDesc

func WithSelectDesc(desc string) Option

func WithSelectDescFunc

func WithSelectDescFunc(desc func() string) Option

func WithSelectTitle

func WithSelectTitle(title string) Option

func WithSingleSelection

func WithSingleSelection() Option

func WithTheme

func WithTheme(theme *huh.Theme) Option

type SelectField

type SelectField struct {
	// contains filtered or unexported fields
}

func NewSelectField

func NewSelectField() *SelectField

func (*SelectField) Field

func (s *SelectField) Field() huh.Field

Jump to

Keyboard shortcuts

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