prompt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SelectTemplateItemActive   = `{{ "✔" | green | bold }} {{ .Name | cyan | bold }}` + SelectTemplateItemHelp
	SelectTemplateItemInactive = `  {{ .Name }}` + SelectTemplateItemHelp
	SelectTemplateItemHelp     = `{{ printf " (%s)" .Help | faint }}`
)

Variables

This section is empty.

Functions

func Select

func Select[T Selection](name string, options []T) (string, error)

Select displays prompt with selection. Name is the prefix displayed before selected item and options contains bulk of items to select from.

func TextInput

func TextInput(name string, required bool) (string, error)

TextInput displays prompt with simple text input where user provides any non-formatted text. Name is the prefix displayed before text input field.

Types

type Selection

type Selection interface {
	Field() string
	Doc() string
}

Selection implements selectable prompt item.

type SelectionItem

type SelectionItem struct {
	Name string
	Help string
}

Jump to

Keyboard shortcuts

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