josa42 / go-prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Prompt

Interactive terminal inputs.

Elements

Select

selection1, _ := prompt.Select("Choose one option", prompt.Options{
	{"1", "One"},
	{"2", "Two"},
	{"3", "Three"},
})
fmt.Println("Selection:", selection1)

MultiSelect

selection, _ := prompt.MultiSelect("Choose multiple options", prompt.Options{
	{"1", "One"},
	{"2", "Two"},
	{"3", "Three"},
})
fmt.Println("Selection:", selection)

Confirm

selection, _ := prompt.Confirm("Do you want to go on?")
fmt.Println("Selection:", selection)

Text Input

selection, _ := prompt.Text("Write single line text", "")
fmt.Println("Selection:", selection)

Multi Line Text Input

selection, _ := prompt.MultiLineText("Write multiple line text", "")
fmt.Println("Selection:\n" + selection)

Prior Art

License

MIT © Josa Gesell

About

License:MIT License


Languages

Language:Go 100.0%