Add support of lein "is not task"

This commit is contained in:
nvbn
2015-04-18 23:19:34 +02:00
parent 3440582494
commit 8b2ba5762c
4 changed files with 49 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
import re
def match(command, settings):
return (command.script.startswith('lein')
and "is not a task. See 'lein help'" in command.stderr
and 'Did you mean this?' in command.stderr)
def get_new_command(command, settings):
broken_cmd = re.findall(r"'([^']*)' is not a task",
command.stderr)[0]
new_cmd = re.findall(r'Did you mean this\?\n\s*([^\n]*)',
command.stderr)[0]
return command.script.replace(broken_cmd, new_cmd, 1)