mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
2966153adf
commit
26c532316a
21 changed files with 355 additions and 75 deletions
|
@ -161,6 +161,27 @@ func (t *Endpoint) String() string {
|
|||
return fmt.Sprintf("%s%s (%s) - %s", ipPart, t.HwAddress, t.Vendor, tui.Bold(name))
|
||||
}
|
||||
|
||||
func (t *Endpoint) ShortString() string {
|
||||
parts := []string{
|
||||
t.IpAddress,
|
||||
}
|
||||
|
||||
if t.Vendor != "" {
|
||||
parts = append(parts, tui.Dim(fmt.Sprintf("(%s)", t.Vendor)))
|
||||
}
|
||||
|
||||
name := t.Hostname
|
||||
if t.Alias != "" {
|
||||
name = t.Alias
|
||||
}
|
||||
|
||||
if name != "" {
|
||||
parts = append(parts, tui.Bold(name))
|
||||
}
|
||||
|
||||
return strings.Join(parts, " ")
|
||||
}
|
||||
|
||||
func (t *Endpoint) OnMeta(meta map[string]string) {
|
||||
host := ""
|
||||
for k, v := range meta {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue