Skip to content

Songmu/prompter

Folders and files

NameName
Last commit message
Last commit date
May 29, 2022
Jul 25, 2015
May 29, 2022
Jul 25, 2015
Mar 20, 2021
Mar 20, 2021
Mar 20, 2021
Jul 25, 2015
May 6, 2020
Jul 25, 2015
May 29, 2022
May 29, 2022
May 29, 2022
Jul 25, 2015

Repository files navigation

prompter

Test Status Coverage Status MIT License GoDev

Description

utility for easy prompting in Golang

Synopsis

twitterID := prompter.Prompt("Enter your twitter ID", "")
lang := prompter.Choose("Which language do you like the most?", []string{"Perl", "Golang", "Scala", "Ruby"}, "Perl")
passwd := prompter.Password("Enter your password")
var likeSushi bool = prompter.YN("Do you like sushi?", true)
var likeBeer bool = prompter.YesNo("Do you like beer?", false)

Features

  • Easy to use
  • Care non-interactive (not a tty) environment
    • Default is used and the process is not blocked
  • No howeyc/gopass (which uses cgo) dependency
    • cross build friendly
  • Customizable prompt setting by using &prompter.Prompter{} directly

License

MIT

Author

Songmu