xonsh/xontrib/bashisms.py

11 lines
275 B
Python
Raw Normal View History

2016-11-15 01:01:34 -05:00
"""Bash-like interface extensions for xonsh."""
2016-11-20 18:49:26 -05:00
@events.on_transform_command
2016-11-15 01:01:34 -05:00
def bash_preproc(cmd):
2016-12-15 22:54:45 +08:00
if not __xonsh_history__.inps:
if cmd.strip() == '!!':
return ''
2016-12-15 22:30:26 +08:00
return cmd
2016-11-15 01:01:34 -05:00
return cmd.replace('!!', __xonsh_history__.inps[-1].strip())