runscript: set sys.argv to remaining arguments (#3015)

This commit is contained in:
Benjamin Dauvergne 2013-06-05 15:10:12 +02:00
parent 1ec749e773
commit bbaae634e4
1 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ class CmdRunScript(Command):
fullpath = os.path.dirname(os.path.abspath(args[0]))
sys.path.append(fullpath)
module_name = os.path.splitext(os.path.basename(args[0]))[0]
sys.argv = args[1:]
runpy.run_module(module_name)
CmdRunScript.register()