dialburn/common/console.go

56 lines
1.3 KiB
Go

package common
import (
"fmt"
"os"
)
var (
colorReset = "\033[0m"
colorRed = "\033[31m"
colorPurple = "\033[35m"
colorCyan = "\033[36m"
colorGreen = "\033[32m"
colorOrange = "\033[91m"
colorGray = "\033[90m"
colorYellow = "\033[93m"
)
func Banner() {
fmt.Print(`
( ( )
)\ ) ( ) )\( /( ( (
_ (()/( )\ ( /(((_)\()) ))\ )( (
//\ ((_)|(_))(_))_((_)\ /((_|()\ )\ )
| \/ _| |(_|(_)_| | |(_|_))( ((_)_(_/(
||~ / _' || / _' | | '_ \ || | '_| ' \)) _ _
||_ \__,_||_\__,_|_|_.__/\_,_|_| |_||_| [ L___I ]
| /\ | ... |
,@\\/ ,@@@, ,@@@@@, | ::: |
@, ,@@" "@@@, ,@@" "@@@, ,@@@@"| ''' |
"@@@@@" "@@@@@" "@@@@" '========='
`)
}
func Success(msg string) {
fmt.Printf(" %s~+~%s %s\n", colorGreen, colorReset, msg)
}
func Info(msg string) {
fmt.Printf(" %s~i~%s %s\n", colorCyan, colorReset, msg)
}
func Warning(msg string) {
fmt.Printf(" %s~!~%s %s\n", colorYellow, colorReset, msg)
}
func Fatal(msg string) {
fmt.Printf(" %s~f~%s %s\n", colorRed, colorReset, msg)
os.Exit(-1)
}
func Usage() {
fmt.Printf(" %s~u~%s usage: dialburn -s <server> [-d (dry run)]\n", colorOrange, colorReset)
}