Skip to content
This repository was archived by the owner on Jan 17, 2021. It is now read-only.

Commit 8c07a08

Browse files
authored
Merge pull request #119 from cdr/improve-bind-flag-doc
Update --bind flag help text
2 parents 6ada57c + add6041 commit 8c07a08

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (c *rootCmd) RegisterFlags(fl *flag.FlagSet) {
5353
fl.BoolVar(&c.skipSync, "skipsync", false, "skip syncing local settings and extensions to remote host")
5454
fl.BoolVar(&c.syncBack, "b", false, "sync extensions back on termination")
5555
fl.BoolVar(&c.printVersion, "version", false, "print version information and exit")
56-
fl.StringVar(&c.bindAddr, "bind", "", "local bind address for ssh tunnel")
56+
fl.StringVar(&c.bindAddr, "bind", "", "local bind address for SSH tunnel, in [HOST][:PORT] syntax (default: 127.0.0.1)")
5757
fl.StringVar(&c.sshFlags, "ssh-flags", "", "custom SSH flags")
5858
}
5959

sshcode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ func sshCode(host, dir string, o options) error {
168168
}
169169

170170
func parseBindAddr(bindAddr string) (string, error) {
171-
if bindAddr == "" {
172-
bindAddr = ":"
171+
if !strings.Contains(bindAddr, ":") {
172+
bindAddr += ":"
173173
}
174174

175175
host, port, err := net.SplitHostPort(bindAddr)

0 commit comments

Comments
 (0)