#!/usr/bin/env python
import os
import sys

output_file = sys.argv[sys.argv.index('-o')+1]

with open(output_file, 'w') as f:
    s = """#!/usr/bin/env python
import sys
with open('run.cmd', 'w') as f:
    f.write(' '.join(sys.argv[1:]) + '\\n')
"""
    f.write(s)
os.chmod(output_file, 0o755)

with open('vcs.cmd', 'w') as f:
    f.write(' '.join(sys.argv[1:]) + '\n')
