mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 18:57:17 -07:00
misc: more compact zerogod.show
This commit is contained in:
parent
7e1cb69071
commit
30c4c320a6
2 changed files with 12 additions and 5 deletions
|
@ -67,7 +67,7 @@ func ippOnGetJobAttributes(ctx *HandlerContext, ipp_req *ipp.Request) {
|
|||
}
|
||||
ipp_resp.OperationAttributes["job-originating-user-name"] = []ipp.Attribute{
|
||||
{
|
||||
Value: "bettercap", // TODO: check if this must match the actual job user from a print operation
|
||||
Value: "bettercap",
|
||||
Tag: ipp.TagName,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -30,11 +30,18 @@ func (mod *ZeroGod) show(filter string, withData bool) error {
|
|||
}
|
||||
|
||||
for _, svc := range entry.Services {
|
||||
fmt.Fprintf(mod.Session.Events.Stdout, " %s (%s) [%v / %v]:%s\n",
|
||||
ip := ""
|
||||
if len(svc.AddrIPv4) > 0 {
|
||||
ip = svc.AddrIPv4[0].String()
|
||||
} else if len(svc.AddrIPv6) > 0 {
|
||||
ip = svc.AddrIPv6[0].String()
|
||||
} else {
|
||||
ip = svc.HostName
|
||||
}
|
||||
|
||||
fmt.Fprintf(mod.Session.Events.Stdout, " %s %s:%s\n",
|
||||
tui.Green(svc.ServiceInstanceName()),
|
||||
tui.Dim(svc.HostName),
|
||||
svc.AddrIPv4,
|
||||
svc.AddrIPv6,
|
||||
ip,
|
||||
tui.Red(fmt.Sprintf("%d", svc.Port)),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue