https://github.com/xyproto/ask
:lips: Ask the user a question on the command line
https://github.com/xyproto/ask
interaction terminal text user-centered-design
Last synced: 6 months ago
JSON representation
:lips: Ask the user a question on the command line
- Host: GitHub
- URL: https://github.com/xyproto/ask
- Owner: xyproto
- License: bsd-3-clause
- Created: 2019-09-18T14:42:27.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T14:24:32.000Z (almost 2 years ago)
- Last Synced: 2025-03-29T03:04:07.633Z (about 1 year ago)
- Topics: interaction, terminal, text, user-centered-design
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ask
Ask the user a question on the command line.
[](https://github.com/xyproto/ask/actions/workflows/go.yml) [](https://godoc.org/github.com/xyproto/ask) [](https://raw.githubusercontent.com/xyproto/ask/master/LICENSE) [](https://goreportcard.com/report/github.com/xyproto/ask)
### Example use
```go
package main
import (
"fmt"
"github.com/xyproto/ask"
)
func main() {
var (
yes bool
name string
)
for !yes {
name = ask.Ask("What is your name? ")
yes = ask.YesNo("Your name is "+name+"?", false)
}
fmt.Printf("Greetings, %s!\n", name)
}
```
### General info
* Version: 1.1.0
* Licence: BSD-3
* Author: Alexander F. Rødseth <xyproto@archlinux.org>