Fixed comma parsing bugs in non-wordlist cli arguments (#298)

This commit is contained in:
Joona Hoikkala 2020-09-16 11:08:09 +03:00 committed by GitHub
parent a71f1c0105
commit f3bcb50e3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

12
main.go
View file

@ -42,7 +42,7 @@ type cliOptions struct {
URL string
outputFormat string
ignoreBody bool
wordlists multiStringFlag
wordlists wordlistFlag
inputcommands multiStringFlag
headers multiStringFlag
cookies multiStringFlag
@ -52,12 +52,22 @@ type cliOptions struct {
}
type multiStringFlag []string
type wordlistFlag []string
func (m *multiStringFlag) String() string {
return ""
}
func (m *wordlistFlag) String() string {
return ""
}
func (m *multiStringFlag) Set(value string) error {
*m = append(*m, value)
return nil
}
func (m *wordlistFlag) Set(value string) error {
delimited := strings.Split(value, ",")
if len(delimited) > 1 {