From 11a8b6168cdd37ba2c038fdc5a95df5335c12eec Mon Sep 17 00:00:00 2001 From: M09Ic Date: Thu, 17 Nov 2022 05:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E--check-only=E5=8F=82?= =?UTF-8?q?=E6=95=B0,=20=E6=9A=82=E6=9C=AA=E5=AE=9E=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/check.go | 1 + internal/option.go | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 internal/check.go diff --git a/internal/check.go b/internal/check.go new file mode 100644 index 0000000..5bf0569 --- /dev/null +++ b/internal/check.go @@ -0,0 +1 @@ +package internal diff --git a/internal/option.go b/internal/option.go index 4ee5192..6a79024 100644 --- a/internal/option.go +++ b/internal/option.go @@ -52,6 +52,7 @@ type RequestOptions struct { Cookie string `long:"cookie"` Force bool `long:"force"` SimhashDistance int `long:"distance"` + CheckOnly bool `long:"--check-only"` } type MiscOptions struct { @@ -72,19 +73,20 @@ func (opt *Option) PrepareRunner() (*Runner, error) { } var err error r := &Runner{ - Progress: uiprogress.New(), - Threads: opt.Threads, - PoolSize: opt.PoolSize, - Mod: opt.Mod, - Timeout: opt.Timeout, - Deadline: opt.Deadline, - Offset: opt.Offset, - Limit: opt.Limit, - URLList: make(chan string), - OutputCh: make(chan *pkg.Baseline, 100), - FuzzyCh: make(chan *pkg.Baseline, 100), - Fuzzy: opt.Fuzzy, - Force: opt.Force, + Progress: uiprogress.New(), + Threads: opt.Threads, + PoolSize: opt.PoolSize, + Mod: opt.Mod, + Timeout: opt.Timeout, + Deadline: opt.Deadline, + Offset: opt.Offset, + Limit: opt.Limit, + URLList: make(chan string), + OutputCh: make(chan *pkg.Baseline, 100), + FuzzyCh: make(chan *pkg.Baseline, 100), + Fuzzy: opt.Fuzzy, + Force: opt.Force, + CheckOnly: opt.CheckOnly, } err = pkg.LoadTemplates()