Merge pull request #107 from kimtree/support-pip

Add a support for pip unknown commands
This commit is contained in:
Vladimir Iakovlev
2015-04-23 15:02:56 +02:00
3 changed files with 46 additions and 6 deletions
+15
View File
@@ -0,0 +1,15 @@
import re
def match(command, settings):
return ('pip' in command.script and
'unknown command' in command.stderr and
'maybe you meant' in command.stderr)
def get_new_command(command, settings):
broken_cmd = re.findall(r'ERROR: unknown command \"([a-z]+)\"',
command.stderr)[0]
new_cmd = re.findall(r'maybe you meant \"([a-z]+)\"', command.stderr)[0]
return command.script.replace(broken_cmd, new_cmd, 1)