SSHTunnel/ReadFlags.go

15 lines
763 B
Go
Raw Permalink Normal View History

2015-01-02 15:51:37 +00:00
package main
import (
"flag"
)
func readFlags() {
flag.StringVar(&serverAddrString, `server`, `127.0.0.1:22`, `The (remote) SSH server, e.g. 'my.host.com', 'my.host.com:22', '127.0.0.1:22', 'localhost:22'.`)
flag.StringVar(&localAddrString, `local`, `127.0.0.1:50000`, `The local end-point of the tunnel, e.g. '127.0.0.1:50000', 'localhost:50000'.`)
flag.StringVar(&remoteAddrString, `remote`, `127.0.0.1:27017`, `The remote side end-point (e.g. on the machine with the SSH server), e.g. a MongoDB (port 27017) '127.0.0.1:27017', a web server '127.0.0.1:80'`)
2015-09-23 18:30:44 +00:00
flag.StringVar(&username, `user`, `username`, `The user's name for the SSH server.`)
flag.StringVar(&password, `pwd`, ``, `The user's password for the SSH server.`)
2015-01-02 15:51:37 +00:00
flag.Parse()
}