Skip to content

josa42/go-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages