diff --git a/README.md b/README.md index ff4a09d..c214ec7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Options: --hc/hl/hw/hh N[,N]+ : Hide responses with the specified code, lines, words, or chars. --sc/sl/sw/sh N[,N]]+ : Show responses with the specified code, lines, words, or chars. -t N : Specify the number of concurrent connections (10 default). --p URL : Specify proxy URL. -b COOKIE : Specify cookie. -ua USERAGENT : Specify user agent. --password PASSWORD : Specify password for basic web auth. diff --git a/libgrequest/helper.go b/libgrequest/helper.go index a65f056..f852ea6 100755 --- a/libgrequest/helper.go +++ b/libgrequest/helper.go @@ -131,7 +131,7 @@ func PrintHelp() { fmt.Println("--hc/hl/hw/hh N[,N]+ : Hide responses with the specified code, lines, words, or chars.") fmt.Println("--sc/sl/sw/sh N[,N]]+ : Show responses with the specified code, lines, words, or chars.") fmt.Println("-t N : Specify the number of concurrent connections (10 default).") - fmt.Println("-p URL : Specify proxy URL.") + // fmt.Println("-p URL : Specify proxy URL.") TODO: need better cmdline parse for two URLs fmt.Println("-b COOKIE : Specify cookie.") fmt.Println("-ua USERAGENT : Specify user agent.") fmt.Println("--password PASSWORD : Specify password for basic web auth.") diff --git a/libgrequest/output.go b/libgrequest/output.go index bd1ab81..4278057 100644 --- a/libgrequest/output.go +++ b/libgrequest/output.go @@ -24,8 +24,10 @@ func PrintChars(s *State, r *Result) { if s.Filter.Contains(r.Chars) == s.Show { if s.NoColor { PrintNoColorFn(s, r) + } else { + PrintColorFn(s, r) } - PrintColorFn(s, r) + } } @@ -34,8 +36,10 @@ func PrintWords(s *State, r *Result) { if s.Filter.Contains(r.Words) == s.Show { if s.NoColor { PrintNoColorFn(s, r) + } else { + PrintColorFn(s, r) } - PrintColorFn(s, r) + } } @@ -44,8 +48,10 @@ func PrintStatus(s *State, r *Result) { if s.Filter.Contains(r.Code) == s.Show { // issue nil if s.NoColor { PrintNoColorFn(s, r) + } else { + PrintColorFn(s, r) } - PrintColorFn(s, r) + } } @@ -54,8 +60,10 @@ func PrintLines(s *State, r *Result) { if s.Filter.Contains(r.Lines) == s.Show { if s.NoColor { PrintNoColorFn(s, r) + } else { + PrintColorFn(s, r) } - PrintColorFn(s, r) + } } diff --git a/main.go b/main.go index 3b5915d..ca5d9dd 100755 --- a/main.go +++ b/main.go @@ -16,10 +16,10 @@ func ParseCmdLine(str string) *libgrequest.State { s.Counter = libgrequest.InitSafeCounter() s.Fuzzer = libgrequest.InitFuzz() s.FollowRedirect = !libgrequest.ArgBool(str, "--no-follow") // !lazydefault1: follow redirect - s.URL = libgrequest.ArgString(str, " htt(p|ps).+") + s.URL = libgrequest.ArgString(str, "htt(p|ps).+") s.InsecureSSL = !libgrequest.ArgBool(str, "-k") // !lazydefault2: skip verify threads := libgrequest.ArgInt(str, "-t.[0-9]*") - proxy := libgrequest.ArgString(str, "-p.htt(p|ps)://(.)*") + proxy := libgrequest.ArgString(str, "-p.htt(p|ps).+") // TODO s.Quiet = libgrequest.ArgBool(str, "-q") s.Cookies = libgrequest.ArgString(str, "-b.[a-zA-Z0-9=/?]*") s.Password = libgrequest.ArgString(str, "--password.[a-zA-Z0-9=/?]*")