2020-05-04 09:24:32 +02:00
|
|
|
package text
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
2020-05-08 18:13:51 +02:00
|
|
|
|
|
|
|
"github.com/leonelquinteros/gotext"
|
2020-05-04 09:24:32 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
const arrow = "==>"
|
|
|
|
const smallArrow = " ->"
|
|
|
|
const opSymbol = ":: "
|
|
|
|
|
|
|
|
func OperationInfoln(a ...interface{}) {
|
|
|
|
fmt.Fprint(os.Stdout, append([]interface{}{boldCode, cyan(opSymbol), boldCode}, a...)...)
|
|
|
|
fmt.Fprintln(os.Stdout, resetCode)
|
|
|
|
}
|
|
|
|
|
|
|
|
func OperationInfo(a ...interface{}) {
|
|
|
|
fmt.Fprint(os.Stdout, append([]interface{}{boldCode, cyan(opSymbol), boldCode}, a...)...)
|
|
|
|
fmt.Fprint(os.Stdout, resetCode+" ")
|
|
|
|
}
|
|
|
|
|
|
|
|
func Info(a ...interface{}) {
|
|
|
|
fmt.Fprint(os.Stdout, append([]interface{}{bold(green(arrow + " "))}, a...)...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Infoln(a ...interface{}) {
|
|
|
|
fmt.Fprintln(os.Stdout, append([]interface{}{bold(green(arrow))}, a...)...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Warn(a ...interface{}) {
|
2020-05-08 18:13:51 +02:00
|
|
|
fmt.Fprint(os.Stdout, append([]interface{}{bold(yellow(smallArrow + " "))}, a...)...)
|
2020-05-04 09:24:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Warnln(a ...interface{}) {
|
|
|
|
fmt.Fprintln(os.Stdout, append([]interface{}{bold(yellow(smallArrow))}, a...)...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Error(a ...interface{}) {
|
2020-05-08 18:13:51 +02:00
|
|
|
fmt.Fprint(os.Stderr, append([]interface{}{bold(red(smallArrow + " "))}, a...)...)
|
2020-05-04 09:24:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Errorln(a ...interface{}) {
|
|
|
|
fmt.Fprintln(os.Stderr, append([]interface{}{bold(red(smallArrow))}, a...)...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func PrintInfoValue(str, value string) {
|
|
|
|
if value == "" {
|
2020-05-08 18:13:51 +02:00
|
|
|
value = gotext.Get("None")
|
2020-05-04 09:24:32 +02:00
|
|
|
}
|
|
|
|
|
2020-05-30 00:43:18 +02:00
|
|
|
fmt.Fprintf(os.Stdout, bold("%-16s%s")+" %s\n", str, ":", value)
|
2020-05-04 09:24:32 +02:00
|
|
|
}
|