Merge pull request #1516 from SirNickolas/master

Fix #1515
This commit is contained in:
Konstantinos Tsakiltzidis 2016-08-01 18:13:49 +00:00 committed by GitHub
commit df00f02baf

View file

@ -159,7 +159,7 @@ def premain(argv=None):
parser.print_help()
parser.exit()
if args.version:
version = '/'.join(('xonsh', __version__)),
version = '/'.join(('xonsh', __version__))
print(version)
parser.exit()
shell_kwargs = {'shell_type': args.shell_type,
@ -224,8 +224,8 @@ def main(argv=None):
# run a script contained in a file
path = os.path.abspath(os.path.expanduser(args.file))
if os.path.isfile(path):
sys.argv = args.args
env['ARGS'] = [args.file] + args.args
sys.argv = [args.file] + args.args
env['ARGS'] = sys.argv[:] # $ARGS is not sys.argv
env['XONSH_SOURCE'] = path
run_script_with_cache(args.file, shell.execer, glb=shell.ctx,
loc=None, mode='exec')