mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 23:33:28 -07:00
fix: simplified code
This commit is contained in:
parent
b3ccec269a
commit
181e112e14
2 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ func NewCommandHandler(name string, expr string, desc string, exec func(args []s
|
||||||
func (h *CommandHandler) Parse(line string) (bool, []string) {
|
func (h *CommandHandler) Parse(line string) (bool, []string) {
|
||||||
result := h.Parser.FindStringSubmatch(line)
|
result := h.Parser.FindStringSubmatch(line)
|
||||||
if len(result) == h.Parser.NumSubexp()+1 {
|
if len(result) == h.Parser.NumSubexp()+1 {
|
||||||
return true, result[1:len(result)]
|
return true, result[1:]
|
||||||
} else {
|
} else {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ func (h *ModuleHandler) Parse(line string) (bool, []string) {
|
||||||
} else {
|
} else {
|
||||||
result := h.Parser.FindStringSubmatch(line)
|
result := h.Parser.FindStringSubmatch(line)
|
||||||
if len(result) == h.Parser.NumSubexp()+1 {
|
if len(result) == h.Parser.NumSubexp()+1 {
|
||||||
return true, result[1:len(result)]
|
return true, result[1:]
|
||||||
} else {
|
} else {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue