input

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package input provides a shell script interface for the text input bubble. https://github.com/charmbracelet/bubbles/tree/master/textinput

It can be used to prompt the user for some input. The text the user entered will be sent to stdout.

$ gum input --placeholder "What's your favorite gum?" > answer.text

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	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_"`
	Value       string       `help:"Initial value (can also be passed via stdin)" default:""`
	CharLimit   int          `help:"Maximum value length (0 for no limit)" default:"400"`
	Width       int          `help:"Input width" default:"40" env:"GUM_INPUT_WIDTH"`
	Password    bool         `help:"Mask input characters" default:"false"`
}

Options are the customization options for the input.

func (Options) BeforeReset

func (o Options) BeforeReset(ctx *kong.Context) error

BeforeReset hook. Used to unclutter style flags.

func (Options) Run

func (o Options) Run() error

Run provides a shell script interface for the text input bubble. https://github.com/charmbracelet/bubbles/textinput

Jump to

Keyboard shortcuts

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