add param: support disable color output

This commit is contained in:
tsosunchia
2023-11-30 17:11:14 +08:00
parent b32947a824
commit f5d1a606b3

View File

@@ -3,6 +3,7 @@ package cmd
import (
"encoding/json"
"fmt"
"github.com/fatih/color"
"log"
"net"
"os"
@@ -70,6 +71,7 @@ func Excute() {
lang := parser.Selector("g", "language", []string{"en", "cn"}, &argparse.Options{Default: "cn",
Help: "Choose the language for displaying [en, cn]"})
file := parser.String("", "file", &argparse.Options{Help: "Read IP Address or domain name from file"})
nocolor := parser.Flag("C", "nocolor", &argparse.Options{Help: "Disable Colorful Output"})
err := parser.Parse(os.Args)
if err != nil {
@@ -86,6 +88,12 @@ func Excute() {
os.Exit(0)
}
if *nocolor {
color.NoColor = true
} else {
color.NoColor = false
}
domain := *str
if *port == 0 {