Skip to content

Commit

Permalink
feat: 增加 nocolor 参数
Browse files Browse the repository at this point in the history
增加 nocolor 参数以适配部分环境
  • Loading branch information
X1r0z committed Aug 8, 2023
1 parent af36278 commit ebb2a8b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"EBurstGo/lib"
"flag"
"github.com/fatih/color"
"io"
"os"
"strings"
Expand All @@ -23,6 +24,7 @@ func main() {
v bool
delay int
debug bool
nocolor bool
)
flag.StringVar(&targetUrl, "url", "", "Exchange 服务器地址")
flag.StringVar(&mode, "mode", "", "指定 Exchange Web 接口")
Expand All @@ -36,13 +38,18 @@ func main() {
flag.IntVar(&delay, "delay", 0, "请求延时")
flag.BoolVar(&v, "verbose", false, "显示详细信息")
flag.BoolVar(&debug, "debug", false, "显示 Debug 信息")
flag.BoolVar(&nocolor, "nocolor", false, "关闭输出颜色")
flag.Parse()

if len(os.Args) == 1 {
flag.Usage()
os.Exit(0)
}

if nocolor {
color.NoColor = true
}

lib.Log = &lib.Logging{Verbose: v, IsDebug: debug}

if targetUrl == "" {
Expand Down

0 comments on commit ebb2a8b

Please sign in to comment.