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

Commit

Permalink
make :PORT optional in parseBindAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
deansheather committed Jun 27, 2019
1 parent 65655b9 commit 0b43319
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (c *rootCmd) RegisterFlags(fl *flag.FlagSet) {
fl.BoolVar(&c.skipSync, "skipsync", false, "skip syncing local settings and extensions to remote host")
fl.BoolVar(&c.syncBack, "b", false, "sync extensions back on termination")
fl.BoolVar(&c.printVersion, "version", false, "print version information and exit")
fl.StringVar(&c.bindAddr, "bind", "", "local bind address for ssh tunnel, in [HOST]:PORT syntax (default: 127.0.0.1)")
fl.StringVar(&c.bindAddr, "bind", "", "local bind address for SSH tunnel, in [HOST][:PORT] syntax (default: 127.0.0.1)")
fl.StringVar(&c.sshFlags, "ssh-flags", "", "custom SSH flags")
}

Expand Down
4 changes: 2 additions & 2 deletions sshcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ func sshCode(host, dir string, o options) error {
}

func parseBindAddr(bindAddr string) (string, error) {
if bindAddr == "" {
bindAddr = ":"
if !strings.Contains(bindAddr, ":") {
bindAddr += ":"
}

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

0 comments on commit 0b43319

Please sign in to comment.