Add support for staging and purging

This commit is contained in:
Daniel
2020-11-24 16:45:57 +01:00
parent f21c16956a
commit 6c9d8535d5
14 changed files with 442 additions and 93 deletions

20
cmds/updatemgr/confirm.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func confirm(msg string) bool {
fmt.Printf("%s: [y|n] ", msg)
scanner := bufio.NewScanner(os.Stdin)
ok := scanner.Scan()
if ok && strings.TrimSpace(scanner.Text()) == "y" {
return true
}
return false
}