Only print addr if necessary in network status service command

This commit is contained in:
Simon Ser 2020-04-05 15:20:13 +02:00
parent 88ef6ee0af
commit 70f54f685a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -223,7 +223,12 @@ func handleServiceNetworkStatus(dc *downstreamConn, params []string) error {
statuses = append(statuses, "current")
}
s := fmt.Sprintf("%v (%v) [%v]", net.GetName(), net.Addr, strings.Join(statuses, ", "))
name := net.GetName()
if name != net.Addr {
name = fmt.Sprintf("%v (%v)", name, net.Addr)
}
s := fmt.Sprintf("%v [%v]", name, strings.Join(statuses, ", "))
if details != "" {
s += ": " + details
}