Merge pull request #333 from mlk/master

basic support for the hdfs dfs <command> when the command misses the …
This commit is contained in:
Vladimir Iakovlev
2015-08-19 17:16:54 +03:00
3 changed files with 49 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import re
from thefuck.utils import (replace_command, get_all_matched_commands)
def match(command, settings):
return (re.search(r"([^:]*): Unknown command.*", command.stderr) != None
and re.search(r"Did you mean ([^?]*)?", command.stderr) != None)
def get_new_command(command, settings):
broken_cmd = re.findall(r"([^:]*): Unknown command.*", command.stderr)[0]
matched = re.findall(r"Did you mean ([^?]*)?", command.stderr)
return replace_command(command, broken_cmd, matched)