mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-18 16:48:39 +00:00
15 lines
390 B
Python
15 lines
390 B
Python
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))
|