mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
fix: do not show empty zeroconf fields
Some checks failed
Build and Push Docker Images / docker (push) Has been cancelled
Linux tests / build (1.22.x, ubuntu-latest) (push) Has been cancelled
macOS tests / build (1.22.x, macos-latest) (push) Has been cancelled
Windows tests / build (1.22.x, windows-latest) (push) Has been cancelled
Some checks failed
Build and Push Docker Images / docker (push) Has been cancelled
Linux tests / build (1.22.x, ubuntu-latest) (push) Has been cancelled
macOS tests / build (1.22.x, macos-latest) (push) Has been cancelled
Windows tests / build (1.22.x, windows-latest) (push) Has been cancelled
This commit is contained in:
parent
fed98adffa
commit
aa819862eb
1 changed files with 15 additions and 6 deletions
|
@ -61,15 +61,24 @@ func (mod *ZeroGod) show(filter string, withData bool) error {
|
||||||
for _, field := range svc.Text {
|
for _, field := range svc.Text {
|
||||||
if field = str.Trim(field); len(field) > 0 {
|
if field = str.Trim(field); len(field) > 0 {
|
||||||
keyval := strings.SplitN(field, "=", 2)
|
keyval := strings.SplitN(field, "=", 2)
|
||||||
rows = append(rows, []string{
|
key := str.Trim(keyval[0])
|
||||||
keyval[0],
|
val := str.Trim(keyval[1])
|
||||||
keyval[1],
|
|
||||||
})
|
if key != "" || val != "" {
|
||||||
|
rows = append(rows, []string{
|
||||||
|
key,
|
||||||
|
val,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tui.Table(mod.Session.Events.Stdout, columns, rows)
|
if len(rows) == 0 {
|
||||||
fmt.Fprintf(mod.Session.Events.Stdout, "\n")
|
fmt.Fprintf(mod.Session.Events.Stdout, " %s\n", tui.Dim("no data"))
|
||||||
|
} else {
|
||||||
|
tui.Table(mod.Session.Events.Stdout, columns, rows)
|
||||||
|
fmt.Fprintf(mod.Session.Events.Stdout, "\n")
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(mod.Session.Events.Stdout, " %s\n", tui.Dim("no data"))
|
fmt.Fprintf(mod.Session.Events.Stdout, " %s\n", tui.Dim("no data"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue