cmd/tailscale/cli: [up] compact QR code
Reduce QR code from 35 to 15 lines by using half-block characters, disabling border and switching to negative. See #6096 for potentially of reducing it further (11 lines) Signed-off-by: Oren Tirosh <orent@hishome.net>pull/8136/head
parent
07eacdfe92
commit
083878a094
|
@ -636,10 +636,11 @@ func runUp(ctx context.Context, cmd string, args []string, upArgs upArgsT) (retE
|
|||
fmt.Fprintf(Stderr, "\nTo authenticate, visit:\n\n\t%s\n\n", *url)
|
||||
if upArgs.qr {
|
||||
q, err := qrcode.New(*url, qrcode.Medium)
|
||||
q.DisableBorder = true
|
||||
if err != nil {
|
||||
log.Printf("QR code error: %v", err)
|
||||
} else {
|
||||
fmt.Fprintf(Stderr, "%s\n", q.ToString(false))
|
||||
fmt.Fprintf(Stderr, "%s\n", q.ToSmallString(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue