From 3d9e994c7870c1861075c2b4d76de3a2a1e9426c Mon Sep 17 00:00:00 2001 From: M09Ic Date: Tue, 3 Jan 2023 17:20:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0-a=E5=8F=82=E6=95=B0,=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=BC=80=E5=90=AF--crawl=E4=B8=8E--active?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/option.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/option.go b/internal/option.go index aad13f6..3da4515 100644 --- a/internal/option.go +++ b/internal/option.go @@ -74,6 +74,7 @@ type RequestOptions struct { } type ModeOptions struct { + Advance bool `short:"a" long:"advance" description:"Bool, enable crawl and active"` Force bool `long:"force" description:"Bool, skip error break"` CheckOnly bool `long:"check-only" description:"Bool, check only"` Recursive string `long:"recursive" default:"current.IsDir()" description:"String,custom recursive rule, e.g.: --recursive current.IsDir()"` @@ -130,7 +131,10 @@ func (opt *Option) PrepareRunner() (*Runner, error) { Crawl: opt.Crawl, Active: opt.Active, } - + if opt.Advance { + r.Crawl = true + r.Active = true + } err = pkg.LoadTemplates() if err != nil { return nil, err