def osx_trace_main(*args):
    old_sys_argv = sys.argv
    old_sys_stdout = sys.stdout
    old_sys_stderr = sys.stderr
    try:
        sys.argv = [old_sys_argv[0]]
        sys.argv.extend(args)
        parser = optparse.OptionParser(usage=osx_trace.main_usage())
        sys.stdout = StringIO.StringIO()
        sys.stderr = sys.stdout
        return osx_trace.main(parser)
    finally:
        sys.argv = old_sys_argv
        sys.stdout = old_sys_stdout
        sys.stderr = old_sys_stderr
def osx_trace_main(*args):
    old_sys_argv = sys.argv
    old_sys_stdout = sys.stdout
    old_sys_stderr = sys.stderr
    try:
        sys.argv = [old_sys_argv[0]]
        sys.argv.extend(args)
        parser = optparse.OptionParser(usage=osx_trace.main_usage())
        sys.stdout = StringIO.StringIO()
        sys.stderr = sys.stdout
        return osx_trace.main(parser)
    finally:
        sys.argv = old_sys_argv
        sys.stdout = old_sys_stdout
        sys.stderr = old_sys_stderr