Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Songmu/prompter
golang utility for easy prompting
https://github.com/Songmu/prompter
Last synced: 9 days ago
JSON representation
golang utility for easy prompting
- Host: GitHub
- URL: https://github.com/Songmu/prompter
- Owner: Songmu
- License: mit
- Created: 2015-07-25T15:43:56.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2022-05-29T10:50:09.000Z (over 2 years ago)
- Last Synced: 2024-10-27T22:39:49.537Z (11 days ago)
- Language: Go
- Size: 32.2 KB
- Stars: 147
- Watchers: 4
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
prompter
=======[![Test Status](https://github.com/Songmu/prompter/workflows/test/badge.svg?branch=main)][actions]
[![Coverage Status](https://codecov.io/gh/Songmu/prompter/branch/main/graph/badge.svg)][codecov]
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license]
[![GoDev](https://pkg.go.dev/badge/github.com/Songmu/prompter)][godev][actions]: https://github.com/Songmu/prompter/actions?workflow=test
[codecov]: https://codecov.io/gh/Songmu/prompter
[license]: https://github.com/Songmu/prompter/blob/main/LICENSE
[godev]: http://pkg.go.dev/github.com/Songmu/prompter## Description
utility for easy prompting in Golang
## Synopsis
```go
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][license]
## Author
[Songmu](https://github.com/Songmu)