def main (argv = None):
    root = get_red_spider_root()
    set_environment(root)
    if argv and len(argv) > 1:                  # call the requested program
        result = call('"' + '" "'.join(argv[1:]) + '"', shell = True)
    else:
        prior_location = os.getcwd()
        os.chdir(root)
        print welcome_msg.format(root, os.path.sep, *variable_wrap)
        os.system("rshelp")
        if os.name == 'nt':                     # Windows
            result = call(os.getenv('COMSPEC', 'cmd.exe'))
        else:                                   # POSIX assumed
            result = call(os.getenv('SHELL', 'bash'))
        os.chdir(prior_location)
    return result
dataset/ETHPy150Open the-xkcd-community/the-red-spider-project/src/rsshell.py/main/original