Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
修复 -qt参数的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rootphantomer committed Sep 15, 2022
1 parent 1d9bb94 commit 128aad3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: ph4nt0mer
* @Date: 2022-09-01 18:39:52
* @LastEditors: rootphantomer
* @LastEditTime: 2022-09-14 14:11:00
* @LastEditTime: 2022-09-15 10:10:17
* @FilePath: /quake_go/README.md
* @Description:
*
Expand Down Expand Up @@ -74,14 +74,15 @@ rust 项目代码 移步这里——https://github.com/360quake/quake_rs/

```bash
Starting Quake Cli...
usage: quake [option] [-e,end_time time=2022-09-07 16:47:32] [-fe,field string] [-h,help bool] [-ic,ignore_cache bool=false] [-qt,query_txt string] [-sz,size string=10] [-st,start string=0] [-s,start_time time=2022-01-01]
usage: quake [option] [args] [-e,end_time time=2022-09-15 10:10:04] [-fe,field string] [-h,help bool] [-ic,ignore_cache bool=false] [-qt,query_txt string] [-sz,size string=10] [-st,start string=0] [-s,start_time time=2022-01-01]

positional options:
option [string] init,info,search
option [string] init,info,search,host
args [string] query value,example port:443

options:
-e, --end_time [time=2022-09-07 16:47:32] -e time to end time flag
-fe, --field [string] -fe body to show body infomation
-e, --end_time [time=2022-09-15 10:10:04] -e time to end time flag
-fe, --field [string] -fe swich body,title,host,html_hash,x_powered_by to show infomation
-h, --help [bool] show usage
-ic, --ignore_cache [bool=false] -ic true or false,default false
-qt, --query_txt [string] -qt ./file.txt file to query search
Expand Down
25 changes: 14 additions & 11 deletions src/apis/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: ph4nt0mer
* @Date: 2022-09-01 15:36:10
* @LastEditors: rootphantomer
* @LastEditTime: 2022-09-15 10:03:03
* @LastEditTime: 2022-09-15 10:16:42
* @FilePath: /quake_go/src/apis/api.go
* @Description:封装请求接口
*
Expand Down Expand Up @@ -38,11 +38,6 @@ func SearchServicePost(reqjson Reqjson, token string) {
// "end_time": "2021-02-01 00:00:00"
// }'
uri := "/search/quake_service"
reqjson.Query = strings.ReplaceAll(reqjson.Query, " ", "")
if reqjson.Query == "" || reqjson.Query == "?" {
fmt.Println("No query specified")
return
}
if reqjson.Query_txt != "" {
bytedata, _ := utils.ReadLine(reqjson.Query_txt)
tmp := ""
Expand All @@ -56,6 +51,12 @@ func SearchServicePost(reqjson Reqjson, token string) {
}
// fmt.Println(tmp)
reqjson.Query = tmp
} else {
reqjson.Query = strings.ReplaceAll(reqjson.Query, " ", "")
if reqjson.Query == "" || reqjson.Query == "?" {
fmt.Println("No query specified")
return
}
}
datajson, err := json.Marshal(reqjson)
if err != nil {
Expand Down Expand Up @@ -144,11 +145,6 @@ func HostSearchPost(reqjson Reqjson, token string) {
// }'

uri := "/search/quake_host"
reqjson.Query = strings.ReplaceAll(reqjson.Query, " ", "")
if reqjson.Query == "" || reqjson.Query == "?" {
fmt.Println("No query specified")
return
}
if reqjson.Query_txt != "" {
bytedata, _ := utils.ReadLine(reqjson.Query_txt)
tmp := ""
Expand All @@ -162,7 +158,14 @@ func HostSearchPost(reqjson Reqjson, token string) {
}
// fmt.Println(tmp)
reqjson.Query = tmp
} else {
reqjson.Query = strings.ReplaceAll(reqjson.Query, " ", "")
if reqjson.Query == "" || reqjson.Query == "?" {
fmt.Println("No query specified")
return
}
}

datajson, err := json.Marshal(reqjson)
if err != nil {
panic(err)
Expand Down

0 comments on commit 128aad3

Please sign in to comment.