mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
Merge branch 'mbollmann-norc'
This commit is contained in:
commit
bfbf256b03
2 changed files with 8 additions and 3 deletions
|
@ -14,6 +14,11 @@ parser.add_argument('-c',
|
||||||
dest='command',
|
dest='command',
|
||||||
required=False,
|
required=False,
|
||||||
default=None)
|
default=None)
|
||||||
|
parser.add_argument('--no-rc',
|
||||||
|
help="Do not load the .xonshrc file",
|
||||||
|
dest='norc',
|
||||||
|
action='store_true',
|
||||||
|
default=False)
|
||||||
parser.add_argument('file',
|
parser.add_argument('file',
|
||||||
metavar='script-file',
|
metavar='script-file',
|
||||||
help='If present, execute the script in script-file'
|
help='If present, execute the script in script-file'
|
||||||
|
@ -33,7 +38,7 @@ def main(argv=None):
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
shell = Shell()
|
shell = Shell() if not args.norc else Shell(ctx={})
|
||||||
|
|
||||||
env = builtins.__xonsh_env__
|
env = builtins.__xonsh_env__
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,8 @@ class Shell(Cmd):
|
||||||
stdout=stdout)
|
stdout=stdout)
|
||||||
self.execer = Execer()
|
self.execer = Execer()
|
||||||
env = builtins.__xonsh_env__
|
env = builtins.__xonsh_env__
|
||||||
self.ctx = ctx or xonshrc_context(rcfile=env.get('XONSHRC', None),
|
self.ctx = ctx if ctx is not None else \
|
||||||
execer=self.execer)
|
xonshrc_context(rcfile=env.get('XONSHRC', None), execer=self.execer)
|
||||||
self.completer = Completer()
|
self.completer = Completer()
|
||||||
self.buffer = []
|
self.buffer = []
|
||||||
self.need_more_lines = False
|
self.need_more_lines = False
|
||||||
|
|
Loading…
Add table
Reference in a new issue