Don't just support bup commands; allow arbitrary commands as arguments,
i.e. instead of
bup mux BUP_SUBCOMMAND ...
support
bup mux COMMAND ...
i.e.
bup mux tar cvf ...
Reviewed-by: Gabriel Filion <gabster@lelutin.ca>
[rlb@defaultvalue.org: rebased to master; removed not yet applicable
on--server-cmd.py changes]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
send both data and debugging/error output over the single
connection stream.
-`bup mux server` might be used in an inetd server setup.
+`bup mux bup server` might be used in an inetd server setup.
# OPTIONS
command
-: the subcommand to run
+: the command to run
options
-: options for command
+: options for the command
# BUP
fd1 = os.dup(s.fileno())
fd2 = os.dup(s.fileno())
s.close()
- sp = subprocess.Popen([path.exe(), 'mux', '--', 'server']
+ sp = subprocess.Popen([path.exe(), 'mux', '--',
+ path.exe(), 'server']
+ extra, stdin=fd1, stdout=fd2)
finally:
os.close(fd1)
from bup.helpers import *
optspec = """
-bup mux command [command arguments...]
+bup mux command [arguments...]
--
"""
o = options.Options(optspec)
if len(extra) < 1:
o.fatal('command is required')
-cmdpath, cmdfn = os.path.split(__file__)
subcmd = extra
-subcmd[0] = os.path.join(cmdpath, 'bup-' + subcmd[0])
debug2('bup mux: starting %r\n' % (extra,))