[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sshproxy-dev] Changes to sshproxy/SSH
From: |
David Guerizec |
Subject: |
[sshproxy-dev] Changes to sshproxy/SSH |
Date: |
Thu, 04 Aug 2005 05:32:51 -0400 |
Index: sshproxy/SSH
diff -u sshproxy/SSH:1.1 sshproxy/SSH:1.2
--- sshproxy/SSH:1.1 Thu Jul 21 09:43:36 2005
+++ sshproxy/SSH Thu Aug 4 09:32:50 2005
@@ -33,25 +33,10 @@
""" % Version
parser = OptionParser(usage)
-parser.add_option("-H", "--host",
- dest="hostname",
- help="connect to HOST",
- metavar="HOST")
parser.add_option("-P", "--proxy",
dest="proxy",
help="connect to PROXY",
metavar="PROXY")
-parser.add_option("-p", "--port",
- dest="port",
- help="connect to HOST on port PORT (deprecated)",
- metavar="PORT",
- default=None,
- type="int")
-parser.add_option("-u", "--user",
- dest="username",
- help="connect as user USER (deprecated)",
- metavar="USER",
- default=os.environ['USER'])
parser.add_option("-L", "--log",
dest="logfile",
help="log to FILE",
@@ -60,37 +45,39 @@
(options, args) = parser.parse_args()
-options.rport = None
-options.ruser = None
-if not hasattr(options, 'hostname') or options.hostname is None:
- if len(args) != 1:
- parser.error("incorrect number of arguments")
- else:
- options.hostname = args[0]
- if options.hostname.find('@') >= 0:
- options.ruser, options.hostname = options.hostname.split('@')
- if options.hostname.find(':') >= 0:
- options.hostname, portstr = options.hostname.split(':')
- options.rport = int(portstr)
+rport = None
+ruser = None
+username = None
+port = None
+if len(args) != 1:
+ parser.error("incorrect number of arguments")
+else:
+ hostname = args[0]
+ if hostname.find('@') >= 0:
+ ruser, hostname = hostname.split('@')
+ if hostname.find(':') >= 0:
+ hostname, portstr = hostname.split(':')
+ rport = int(portstr)
if not hasattr(options, 'proxy') or not options.proxy:
- options.proxy = None
+ proxy = None
else:
- if options.proxy.find('@') >= 0:
- options.username, options.proxy = options.proxy.split('@')
- if options.proxy.find(':') >= 0:
- options.proxy, portstr = options.proxy.split(':')
- options.port = int(portstr)
+ proxy = options.proxy
+ if proxy.find('@') >= 0:
+ username, proxy = proxy.split('@')
+ if proxy.find(':') >= 0:
+ proxy, portstr = proxy.split(':')
+ port = int(portstr)
paramiko.util.log_to_file(options.logfile)
password = getpass.getpass("Password: ")
-start_client(username=options.username,
+start_client(username=username,
password=password,
- proxy=options.proxy,
- port=options.port,
- ruser=options.ruser,
- hostname=options.hostname,
- rport=options.rport)
+ proxy=proxy,
+ port=port,
+ ruser=ruser,
+ hostname=hostname,
+ rport=rport)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [sshproxy-dev] Changes to sshproxy/SSH,
David Guerizec <=