cmd: re-use existing ui library
Also, move CLI-only utils into `cmd` rather than the top-level package. Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Fatalf(msg string, args ...interface{}) {
|
||||
if !strings.HasSuffix(msg, "\n") {
|
||||
msg += "\n"
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, msg, args...)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func Fatal(msg interface{}) {
|
||||
Fatalf("%s\n", msg)
|
||||
}
|
||||
|
||||
func Info(msg string, args ...interface{}) {
|
||||
if !strings.HasSuffix(msg, "\n") {
|
||||
msg += "\n"
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "[info] "+msg, args...)
|
||||
}
|
Reference in New Issue
Block a user