示例#1
0
def get_new_command(command):
    cmd = re.match(r"ambiguous command: (.*), could be: (.*)",
                   command.stderr)

    old_cmd = cmd.group(1)
    suggestions = [c.strip() for c in cmd.group(2).split(',')]

    return replace_command(command, old_cmd, suggestions)
示例#2
0
def get_new_command(command):
    failed_lifecycle = _get_failed_lifecycle(command)
    available_lifecycles = _getavailable_lifecycles(command)
    if available_lifecycles and failed_lifecycle:
        selected_lifecycle = get_close_matches(
            failed_lifecycle.group(1), available_lifecycles.group(1).split(", "),
            3, 0.6)
        return replace_command(command, failed_lifecycle.group(1), selected_lifecycle)
    else:
        return []
def get_new_command(command):
    wrong_command = re.findall(
        r"docker: '(\w+)' is not a docker command.", command.stderr)[0]
    return replace_command(command, wrong_command, get_docker_commands())
示例#4
0
def get_new_command(command):
    wrong_task = re.findall(r"Task '(\w+)' is not in your gulpfile",
                            command.stdout)[0]
    return replace_command(command, wrong_task, get_gulp_tasks())
def get_new_command(command):
    invalid_operation = command.stderr.split()[-1]
    operations = _get_operations(command.script_parts[0])
    return replace_command(command, invalid_operation, operations)
示例#6
0
def get_new_command(command):
    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)
def get_new_command(command):
    wrong = re.findall(r'`(\w+)` is not a heroku command', command.stderr)[0]
    return replace_command(command, wrong, _get_suggests(command.stderr))
示例#8
0
def get_new_command(command):
    broken_cmd = re.findall(r"git: '([^']*)' is not a git command",
                            command.stderr)[0]
    matched = get_all_matched_commands(command.stderr)
    return replace_command(command, broken_cmd, matched)
示例#9
0
def get_new_command(command):
    broken_cmd = re.findall(r'Error: Unknown command: ([a-z]+)',
                            command.stderr)[0]
    return replace_command(command, broken_cmd, _brew_commands())
示例#10
0
def get_new_command(command):
    broken_cmd = re.findall(r"'([^']*)' is not a task", command.stderr)[0]
    new_cmds = get_all_matched_commands(command.stderr, 'Did you mean this?')
    return replace_command(command, broken_cmd, new_cmds)
示例#11
0
def get_new_command(command):
    broken_cmd = re.findall(r'tsuru: "([^"]*)" is not a tsuru command',
                            command.stderr)[0]
    return replace_command(command, broken_cmd,
                           get_all_matched_commands(command.stderr))
def get_new_command(command):
    broken_cmd = re.findall(r'Error: Unknown command: ([a-z]+)',
                            command.stderr)[0]
    return replace_command(command, broken_cmd, _brew_commands())
示例#13
0
def get_new_command(command):
    wrong_task = re.findall(r"Task '(\w+)' is not in your gulpfile",
                            command.stdout)[0]
    return replace_command(command, wrong_task, get_gulp_tasks())
示例#14
0
def get_new_command(command):
    pgr = command.script_parts[-1]

    return replace_command(command, pgr, get_pkgfile(pgr))