diff --git a/README.md b/README.md index 5aee600..4962c09 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ zapconnect ``` -i, --localip Use local ip instead of public ip. +-l, --localhost Use 127.0.0.1 for ip. -j, --json Display json instead of a QRCode. --lnddir= The base directory that contains lnd's data, logs, configuration file, etc. diff --git a/config.go b/config.go index 952aa90..94ddef6 100644 --- a/config.go +++ b/config.go @@ -31,6 +31,7 @@ var ( // loading+parsing process. type config struct { LocalIp bool `short:"i" long:"localip" description:"Include local ip in QRCode."` + Localhost bool `short:"l" long:"localhost" description:"Use 127.0.0.1 for ip."` Json bool `short:"j" long:"json" description:"Generate json instead of a QRCode."` LndDir string `long:"lnddir" description:"The base directory that contains lnd's data, logs, configuration file, etc."` ConfigFile string `long:"C" long:"configfile" description:"Path to configuration file"` diff --git a/zapconnect.go b/zapconnect.go index 07248dd..7dd1f03 100644 --- a/zapconnect.go +++ b/zapconnect.go @@ -82,6 +82,8 @@ func main() { ipString := "" if loadedConfig.LocalIp { ipString = getLocalIP() + ":10009" + } else if loadedConfig.Localhost { + ipString = "127.0.0.1:10009" } else { ipString = getPublicIP() + ":10009" }