Categorygithub.com/gobwas/prompt
modulepackage
0.2.2
Repository: https://github.com/gobwas/prompt.git
Documentation: pkg.go.dev

# README

prompt

GoDoc CI

Ascetic and minimalistic CLI prompt library.

This is yet another CLI prompt library in Go. Its main purpose is to provide as simple as possible API for both users of the library and users of the program using this library.

Usage

// Simple line reading.
name, _ := prompt.ReadLine(ctx, "What's your name? ")

// Y/n confirmation.
yes, _ := prompt.Confirm(context.TODO(), name+", do you want to continue?")
if !yes {
	return
}

// Menu with single possible answer.
x, _ := prompt.SelectSingle(ctx, 
	"Which football club is your favorite?", 
	[]string{
		"FC Barcelona",
		"Spartak Moscow",
		"Manchester United",
		"Juventus",
	},
)

For more details please visit example folder.

Screencast

This screencast was recorded by running binary from example folder.

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author