askme

package module
v0.0.0-...-bf7d4f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

askme

Go module providing basic command-line Q&A functionality

For usage see example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskYN

func AskYN(s string) bool

askForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y" and "n" will work too. It returns true if the user typed "yes", false otherwise.

Types

type Answer

type Answer int32
const (
	Yes Answer = iota
	No
	Skip
	Quit
)

func Ask

func Ask(s string) Answer

Ask prints a string and asks the user for confirmation, giving options for "yes", "no", "skip", and "quit". If multiple responses are submitted, it will match against "quit", "skip" and "no" ahead of "yes"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL