mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
new: new net.show.meta boolean flag to enable or disable endpoints metainfo rendering
This commit is contained in:
parent
6f691245e0
commit
9f64372273
2 changed files with 15 additions and 4 deletions
|
@ -110,6 +110,11 @@ func (d *Discovery) getRow(e *network.Endpoint, withMeta bool) [][]string {
|
|||
}
|
||||
|
||||
func (d *Discovery) Show(by string, addr string) error {
|
||||
err, showMeta := d.BoolParam("net.show.meta")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
targets := d.Session.Lan.List()
|
||||
if by == "seen" {
|
||||
sort.Sort(BySeenSorter(targets))
|
||||
|
@ -141,10 +146,12 @@ func (d *Discovery) Show(by string, addr string) error {
|
|||
}
|
||||
|
||||
hasMeta := false
|
||||
for _, t := range targets {
|
||||
if !t.Meta.Empty() {
|
||||
hasMeta = true
|
||||
break
|
||||
if showMeta {
|
||||
for _, t := range targets {
|
||||
if !t.Meta.Empty() {
|
||||
hasMeta = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue