]> arthur.barton.de Git - bup.git/blobdiff - cmd/on-cmd.py
options: remove unused 'exe' parameter
[bup.git] / cmd / on-cmd.py
index da7be3757ff32904718f8bd48c1313de58c9f2b8..e9a4a23887580b830d2600f93a8df03fec306ffd 100755 (executable)
@@ -8,7 +8,7 @@ bup on <hostname> index ...
 bup on <hostname> save ...
 bup on <hostname> split ...
 """
-o = options.Options('bup on', optspec, optfunc=getopt.getopt)
+o = options.Options(optspec, optfunc=getopt.getopt)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 if len(extra) < 2:
     o.fatal('arguments expected')
@@ -28,9 +28,14 @@ p = None
 ret = 99
 
 try:
-    hostname = extra[0]
+    hp = extra[0].split(':')
+    if len(hp) == 1:
+        (hostname, port) = (hp[0], None)
+    else:
+        (hostname, port) = hp
+
     argv = extra[1:]
-    p = ssh.connect(hostname, 'on--server')
+    p = ssh.connect(hostname, port, 'on--server')
 
     argvs = '\0'.join(['bup'] + argv)
     p.stdin.write(struct.pack('!I', len(argvs)) + argvs)