You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/data/fakessh.py

17 lines
345 B
Python

7 years ago
#!/usr/bin/env python
import optparse
import os
import shlex
import sys
parser = optparse.OptionParser()
parser.add_option('--user', '-l', action='store')
parser.disable_interspersed_args()
opts, args = parser.parse_args(sys.argv[1:])
args.pop(0) # hostname
args = [''.join(shlex.split(s)) for s in args]
print args
os.execvp(args[0], args)