ipn: add hostname to Prefs.Pretty output

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/1694/head
Brad Fitzpatrick 4 years ago
parent 4c3f7c06fc
commit a3113a793a

@ -256,6 +256,9 @@ func (p *Prefs) pretty(goos string) string {
if p.ControlURL != "" && p.ControlURL != "https://login.tailscale.com" {
fmt.Fprintf(&sb, "url=%q ", p.ControlURL)
}
if p.Hostname != "" {
fmt.Fprintf(&sb, "host=%q ", p.Hostname)
}
if p.Persist != nil {
sb.WriteString(p.Persist.Pretty())
} else {

@ -393,6 +393,13 @@ func TestPrefsPretty(t *testing.T) {
"linux",
`Prefs{ra=false mesh=false dns=false want=false exit=myNodeABC routes=[] nf=off Persist=nil}`,
},
{
Prefs{
Hostname: "foo",
},
"linux",
`Prefs{ra=false mesh=false dns=false want=false routes=[] nf=off host="foo" Persist=nil}`,
},
}
for i, tt := range tests {
got := tt.p.pretty(tt.os)

Loading…
Cancel
Save