Cosmetic changes

This commit is contained in:
Ice3man543 2021-03-14 01:44:35 +05:30
parent 4a96f95086
commit 35402d6414
2 changed files with 3 additions and 3 deletions

View File

@ -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.ReportingConfig, "report-config", "rc", "", "Nuclei Reporting Module configuration file")
set.StringVarP(&options.ReportingDB, "report-db", "rdb", "", "Local Nuclei Reporting Database") 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.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.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.Headless, "headless", false, "Enable headless browser based templates support")
set.BoolVar(&options.ShowBrowser, "show-browser", false, "Show the browser on the screen") set.BoolVar(&options.ShowBrowser, "show-browser", false, "Show the browser on the screen")

View File

@ -52,13 +52,13 @@ func Parse(filePath string, options protocols.ExecuterOptions) (*Template, error
matchWithTags := false matchWithTags := false
if len(options.Options.Tags) > 0 { if len(options.Options.Tags) > 0 {
if err := matchTemplateWithTags(types.ToString(templateTags), types.ToString(template.Info["severity"]), options.Options.Tags); err != nil { 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 matchWithTags = true
} }
if len(options.Options.ExcludeTags) > 0 && !matchWithTags { if len(options.Options.ExcludeTags) > 0 && !matchWithTags {
if err := matchTemplateWithTags(types.ToString(templateTags), types.ToString(template.Info["severity"]), options.Options.ExcludeTags); err == nil { 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)
} }
} }