mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: using tui.Table for wifi.show.wps output
This commit is contained in:
parent
62db3a0be0
commit
696c056b56
1 changed files with 14 additions and 5 deletions
|
@ -331,14 +331,20 @@ func (w *WiFiModule) ShowWPS(bssid string) (err error) {
|
|||
}
|
||||
|
||||
sort.Sort(ByBssidSorter(toShow))
|
||||
|
||||
colNames := []string{"Name", "Value"}
|
||||
|
||||
for _, station := range toShow {
|
||||
ssid := station.ESSID()
|
||||
if ssid == "<hidden>" {
|
||||
ssid = tui.Dim(ssid)
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
fmt.Printf("* %s (%s ch:%d):\n", tui.Bold(ssid), tui.Dim(station.BSSID()), station.Channel())
|
||||
rows := [][]string{
|
||||
[]string{tui.Green("essid"), ssid},
|
||||
[]string{tui.Green("bssid"), station.BSSID()},
|
||||
}
|
||||
|
||||
keys := []string{}
|
||||
for name := range station.WPS {
|
||||
keys = append(keys, name)
|
||||
|
@ -346,11 +352,14 @@ func (w *WiFiModule) ShowWPS(bssid string) (err error) {
|
|||
sort.Strings(keys)
|
||||
|
||||
for _, name := range keys {
|
||||
fmt.Printf(" %s: %s\n", name, tui.Yellow(station.WPS[name]))
|
||||
rows = append(rows, []string{
|
||||
tui.Green(name),
|
||||
tui.Yellow(station.WPS[name]),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
tui.Table(os.Stdout, colNames, rows)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue