cmd/tailscale/cli: tweak the status name column a bit

* make peers without DNS names show their hostnames as always one column, for cut/etc users
* remove trailing dot from shared peers' DNS names
pull/1137/head
Brad Fitzpatrick 4 years ago
parent 420c7a35e2
commit a45665426b

@ -206,9 +206,9 @@ func dnsOrQuoteHostname(st *ipnstate.Status, ps *ipnstate.PeerStatus) string {
return ps.DNSName[:i]
}
if ps.DNSName != "" {
return ps.DNSName
return strings.TrimRight(ps.DNSName, ".")
}
return fmt.Sprintf("- (%q)", ps.SimpleHostName())
return fmt.Sprintf("(%q)", strings.ReplaceAll(ps.SimpleHostName(), " ", "_"))
}
func sortKey(ps *ipnstate.PeerStatus) string {

Loading…
Cancel
Save