mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Update on_transform_command
This commit is contained in:
parent
2acb4eb9be
commit
fdb4a6ac35
3 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ def test_pwd_tracks_cwd(xonsh_builtins, xonsh_execer, tmpdir_factory, monkeypatc
|
|||
|
||||
def test_transform(xonsh_builtins):
|
||||
@xonsh_builtins.events.on_transform_command
|
||||
def spam2egg(cmd):
|
||||
def spam2egg(cmd, **_):
|
||||
if cmd == 'spam':
|
||||
return 'egg'
|
||||
else:
|
||||
|
|
|
@ -50,7 +50,7 @@ def transform_command(src, show_diff=True):
|
|||
raw = src
|
||||
while src != lst:
|
||||
lst = src
|
||||
srcs = events.on_transform_command.fire(src)
|
||||
srcs = events.on_transform_command.fire(cmd=src)
|
||||
for s in srcs:
|
||||
if s != lst:
|
||||
src = s
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
@events.on_transform_command
|
||||
def bash_preproc(cmd):
|
||||
def bash_preproc(cmd, **kw):
|
||||
if not __xonsh_history__.inps:
|
||||
if cmd.strip() == '!!':
|
||||
return ''
|
||||
|
|
Loading…
Add table
Reference in a new issue