2022-07-06 18:06:08 +02:00
|
|
|
package input
|
|
|
|
|
2022-07-12 22:05:40 +02:00
|
|
|
import "github.com/charmbracelet/gum/style"
|
|
|
|
|
2022-07-06 18:06:08 +02:00
|
|
|
// Options are the customization options for the input.
|
|
|
|
type Options struct {
|
2022-08-03 23:43:32 +02:00
|
|
|
Placeholder string `help:"Placeholder value" default:"Type something..." env:"GUM_INPUT_PLACEHOLDER"`
|
|
|
|
Prompt string `help:"Prompt to display" default:"> " env:"GUM_INPUT_PROMPT"`
|
|
|
|
PromptStyle style.Styles `embed:"" prefix:"prompt." envprefix:"GUM_INPUT_PROMPT_"`
|
|
|
|
CursorStyle style.Styles `embed:"" prefix:"cursor." set:"defaultForeground=212" envprefix:"GUM_INPUT_CURSOR_"`
|
2022-07-12 22:30:17 +02:00
|
|
|
Value string `help:"Initial value (can also be passed via stdin)" default:""`
|
2022-08-03 10:44:00 +02:00
|
|
|
CharLimit int `help:"Maximum value length (0 for no limit)" default:"400"`
|
2022-08-03 23:43:32 +02:00
|
|
|
Width int `help:"Input width" default:"40" env:"GUM_INPUT_WIDTH"`
|
2022-07-29 17:19:40 +02:00
|
|
|
Password bool `help:"Mask input characters" default:"false"`
|
2022-12-13 21:05:10 +01:00
|
|
|
Header string `help:"Header value" default:"" env:"GUM_INPUT_HEADER"`
|
|
|
|
HeaderStyle style.Styles `embed:"" prefix:"header." set:"defaultForeground=240" envprefix:"GUM_INPUT_HEADER_"`
|
2022-07-06 18:06:08 +02:00
|
|
|
}
|