An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# ask

Ask the user a question on the command line.

[![Go](https://github.com/xyproto/ask/actions/workflows/go.yml/badge.svg)](https://github.com/xyproto/ask/actions/workflows/go.yml) [![GoDoc](https://godoc.org/github.com/xyproto/ask?status.svg)](https://godoc.org/github.com/xyproto/ask) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/ask/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/ask)](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>