diff --git a/README.md b/README.md index 0948f34..670ee98 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ lndconnect -l, --localhost Use 127.0.0.1 for ip --host= Use specific host name -p, --port= Use this port (default: 10009) +-j, --url Display url instead of a QRCode -o, --image Output QRCode to file --invoice Use invoice macaroon --readonly Use readonly macaroon @@ -36,5 +37,4 @@ lndconnect --adminmacaroonpath= Path to read the admin macaroon from --readonlymacaroonpath= Path to read the read-only macaroon from --invoicemacaroonpath= Path to read the invoice-only macaroon from - ``` diff --git a/config.go b/config.go index 900672d..045c2bd 100644 --- a/config.go +++ b/config.go @@ -47,7 +47,7 @@ type lndConnectConfig struct { Localhost bool `short:"l" long:"localhost" description:"Use 127.0.0.1 for ip"` Host string `long:"host" description:"Use specific host name"` Port uint16 `short:"p" long:"port" description:"Use this port"` - Json bool `short:"j" long:"json" description:"Generate json instead of a QRCode"` + Url bool `short:"j" long:"url" description:"Display url instead of a QRCode"` Image bool `short:"o" long:"image" description:"Output QRCode to file"` Invoice bool `long:"invoice" description:"use invoice macaroon"` Readonly bool `long:"readonly" description:"use readonly macaroon"` diff --git a/lndconnect.go b/lndconnect.go index f53842f..a28904b 100644 --- a/lndconnect.go +++ b/lndconnect.go @@ -13,12 +13,6 @@ import ( "github.com/skip2/go-qrcode" ) -type certificates struct { - Cert string `json:"c"` - Macaroon string `json:"m"` - Ip string `json:"ip,omitempty"` -} - func getLocalIP() string { addrs, err := net.InterfaceAddrs() if err != nil { @@ -98,7 +92,7 @@ func main() { urlString := fmt.Sprintf("lndconnect://%s?cert=%s&macaroon=%s", ipString, certificate, macaroonB64) - if loadedConfig.LndConnect.Json { + if loadedConfig.LndConnect.Url { fmt.Println(urlString) } else if loadedConfig.LndConnect.Image { qrcode.WriteFile(urlString, qrcode.Medium, 512, "lndconnect-qr.png")