1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
package main
import (
"github.com/charmbracelet/huh"
)
func main() {
var file string
huh.NewForm(
huh.NewGroup(
huh.NewInput().
Title("Name").
Description("What's your name?"),
huh.NewInput().
Title("Username").
Description("Select your username."),
huh.NewFilePicker().
Title("Profile").
Description("Select your profile picture.").
AllowedTypes([]string{".png", ".jpeg", ".webp", ".gif"}).
Value(&file),
huh.NewInput().
Title("Password").
EchoMode(huh.EchoModePassword).
Description("Set your Password."),
),
).WithShowHelp(true).Run()
}
|