1
0
mirror of https://github.com/rancher/os.git synced 2025-05-02 13:23:23 +00:00
os/cmd/control/util.go

20 lines
272 B
Go
Raw Normal View History

2016-06-06 22:13:15 +00:00
package control
import (
"fmt"
"strings"
"github.com/rancher/os/log"
2016-06-06 22:13:15 +00:00
)
func yes(question string) bool {
2016-06-06 22:13:15 +00:00
fmt.Printf("%s [y/N]: ", question)
var line string
_, err := fmt.Scan(&line)
2016-06-06 22:13:15 +00:00
if err != nil {
log.Fatal(err)
}
return strings.ToLower(line[0:1]) == "y"
}