diff --git a/v2/cmd/nuclei/main.go b/v2/cmd/nuclei/main.go index e52b71331..9acf01951 100644 --- a/v2/cmd/nuclei/main.go +++ b/v2/cmd/nuclei/main.go @@ -79,7 +79,7 @@ based on templates offering massive extensibility and ease of use.`) set.StringVarP(&options.ReportingConfig, "report-config", "rc", "", "Nuclei Reporting Module configuration file") set.StringVarP(&options.ReportingDB, "report-db", "rdb", "", "Local Nuclei Reporting Database") set.StringSliceVar(&options.Tags, "tags", []string{}, "Tags to execute templates for") - set.StringSliceVar(&options.ExcludeTags, "exclude-tags", []string{}, "Exclude templates with the provided tags") + set.StringSliceVarP(&options.ExcludeTags, "exclude-tags", "etags", []string{}, "Exclude templates with the provided tags") set.StringVarP(&options.ResolversFile, "resolvers", "r", "", "File containing resolver list for nuclei") 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") diff --git a/v2/pkg/templates/compile.go b/v2/pkg/templates/compile.go index 1dbfabc56..4cad174bc 100644 --- a/v2/pkg/templates/compile.go +++ b/v2/pkg/templates/compile.go @@ -52,13 +52,13 @@ func Parse(filePath string, options protocols.ExecuterOptions) (*Template, error matchWithTags := false if len(options.Options.Tags) > 0 { if err := matchTemplateWithTags(types.ToString(templateTags), types.ToString(template.Info["severity"]), options.Options.Tags); err != nil { - return nil, nil + return nil, fmt.Errorf("tags filter not matched %s", templateTags) } matchWithTags = true } if len(options.Options.ExcludeTags) > 0 && !matchWithTags { if err := matchTemplateWithTags(types.ToString(templateTags), types.ToString(template.Info["severity"]), options.Options.ExcludeTags); err == nil { - return nil, nil + return nil, fmt.Errorf("exclude-tags filter matched %s", templateTags) } }