import re from thefuck.utils import replace_argument def match(command): return ('Did you mean this?' in command.output and 'Invalid argument' in command.output) def get_new_command(command): broken = command.script_parts[1] fix = re.findall(r' ([a-zA-z]*)', command.output)[0] return replace_argument(command.script, broken, fix) enabled_by_default = True priority = 100