1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-18 16:48:39 +00:00

15 lines
390 B
Python
Raw Normal View History

2015-07-04 14:17:33 +02:00
import re
def match(command, settings):
return ('tmux' in command.script
and 'ambiguous command:' in command.stderr
and 'could be:' in command.stderr)
def get_new_command(command, settings):
cmd = re.match(r"ambiguous command: (.*), could be: ([^, \n]*)",
command.stderr)
return command.script.replace(cmd.group(1), cmd.group(2))