mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
load import hooks in main
This commit is contained in:
parent
08609ca0ca
commit
636f6f61aa
1 changed files with 2 additions and 5 deletions
|
@ -3,10 +3,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import shlex
|
import shlex
|
||||||
import signal
|
import signal
|
||||||
|
import builtins
|
||||||
import subprocess
|
import subprocess
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
import builtins
|
|
||||||
from xonsh.shell import Shell
|
from xonsh.shell import Shell
|
||||||
|
|
||||||
parser = ArgumentParser(description='xonsh')
|
parser = ArgumentParser(description='xonsh')
|
||||||
|
@ -36,13 +36,10 @@ parser.add_argument('args',
|
||||||
|
|
||||||
def main(argv=None):
|
def main(argv=None):
|
||||||
"""Main entry point for xonsh cli."""
|
"""Main entry point for xonsh cli."""
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
shell = Shell() if not args.norc else Shell(ctx={})
|
shell = Shell() if not args.norc else Shell(ctx={})
|
||||||
|
from xonsh import imphooks
|
||||||
env = builtins.__xonsh_env__
|
env = builtins.__xonsh_env__
|
||||||
|
|
||||||
if args.command is not None:
|
if args.command is not None:
|
||||||
# run a single command and exit
|
# run a single command and exit
|
||||||
shell.default(args.command)
|
shell.default(args.command)
|
||||||
|
|
Loading…
Add table
Reference in a new issue