1
0
mirror of https://github.com/rancher/os.git synced 2025-05-17 04:19:30 +00:00
os/cmd/control/util.go
2017-02-17 03:20:04 -05:00

22 lines
310 B
Go

package control
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/rancher/os/log"
)
func yes(question string) bool {
fmt.Printf("%s [y/N]: ", question)
in := bufio.NewReader(os.Stdin)
line, err := in.ReadString('\n')
if err != nil {
log.Fatal(err)
}
return strings.ToLower(line[0:1]) == "y"
}