mirror of
https://github.com/rancher/os.git
synced 2025-09-03 07:44:21 +00:00
First class consoles
This commit is contained in:
19
cmd/control/util.go
Normal file
19
cmd/control/util.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package control
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
func yes(in *bufio.Reader, question string) bool {
|
||||
fmt.Printf("%s [y/N]: ", question)
|
||||
line, err := in.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return strings.ToLower(line[0:1]) == "y"
|
||||
}
|
Reference in New Issue
Block a user