添加-a参数, 自动开启--crawl与--active

This commit is contained in:
M09Ic 2023-01-03 17:20:07 +08:00
parent 77d4e25c9e
commit 3d9e994c78

View File

@ -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