mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 17:35:26 +00:00
Added stats-interval flag
This commit is contained in:
parent
ec3f85e032
commit
9b79f9b13c
@ -86,6 +86,7 @@ based on templates offering massive extensibility and ease of use.`)
|
||||
set.BoolVar(&options.Headless, "headless", false, "Enable headless browser based templates support")
|
||||
set.BoolVar(&options.ShowBrowser, "show-browser", false, "Show the browser on the screen")
|
||||
set.BoolVarP(&options.Workflows, "w", "workflows", false, "Only run workflow templates with nuclei")
|
||||
set.IntVar(&options.StatsInterval, "stats-interval", 5, "Number of seconds between each stats line")
|
||||
_ = set.Parse()
|
||||
|
||||
if cfgFile != "" {
|
||||
|
||||
@ -23,10 +23,10 @@ type Progress struct {
|
||||
}
|
||||
|
||||
// NewProgress creates and returns a new progress tracking object.
|
||||
func NewProgress(active, metrics bool, port int) (*Progress, error) {
|
||||
func NewProgress(duration int, active, metrics bool, port int) (*Progress, error) {
|
||||
var tickDuration time.Duration
|
||||
if active {
|
||||
tickDuration = 5 * time.Second
|
||||
tickDuration = time.Duration(duration) * time.Second
|
||||
} else {
|
||||
tickDuration = -1
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ func New(options *types.Options) (*Runner, error) {
|
||||
|
||||
// Creates the progress tracking object
|
||||
var progressErr error
|
||||
runner.progress, progressErr = progress.NewProgress(options.EnableProgressBar, options.Metrics, options.MetricsPort)
|
||||
runner.progress, progressErr = progress.NewProgress(options.StatsInterval, options.EnableProgressBar, options.Metrics, options.MetricsPort)
|
||||
if progressErr != nil {
|
||||
return nil, progressErr
|
||||
}
|
||||
|
||||
@ -100,5 +100,8 @@ type Options struct {
|
||||
ShowBrowser bool
|
||||
// Workflows specifies if only to execute workflows (no normal templates will be run)
|
||||
Workflows bool
|
||||
// StatsInterval is the number of seconds to display stats after
|
||||
StatsInterval int
|
||||
|
||||
InternalResolversList []string // normalized from resolvers flag as well as file provided.
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user