def get_new_command(command):
    misspelled_task = regex.findall(command.output)[0]
    if misspelled_task in npm_commands:
        yarn_command = npm_commands[misspelled_task]
        return replace_argument(command.script, misspelled_task, yarn_command)
    else:
        tasks = _get_all_tasks()
        return replace_command(command, misspelled_task, tasks)
Beispiel #2
0
def get_new_command(command):
    if no_website in command.stderr:
        return ['hostscli websites']

    misspelled_command = re.findall(
        r'Error: No such command ".*"', command.stderr)[0]
    commands = ['block', 'unblock', 'websites', 'block_all', 'unblock_all']
    return replace_command(command, misspelled_command, commands)
Beispiel #3
0
def get_new_command(command):
    cmd = re.match(r"ambiguous command: (.*), could be: (.*)",
                   command.stderr)

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

    return replace_command(command, old_cmd, suggestions)
def get_new_command(command):
    misspelled_env = command.script_parts[1]
    create_new = u"mkvirtualenv {}".format(misspelled_env)

    available = _get_all_environments()
    if available:
        return replace_command(command, misspelled_env, available) + [create_new]
    else:
        return create_new
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(", "))
        return replace_command(command, failed_lifecycle.group(1), selected_lifecycle)
    else:
        return []
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)
Beispiel #7
0
def get_new_command(command):
    broken = re.findall(r"git bisect ([^ $]*).*", command.script)[0]
    usage = re.findall(r"usage: git bisect \[([^\]]+)\]", command.stderr)[0]
    return replace_command(command, broken, usage.split("|"))
Beispiel #8
0
def get_new_command(command, settings):
    broken_cmd = re.findall(r'Error: Unknown command: ([a-z]+)',
                            command.stderr)[0]
    return replace_command(command, broken_cmd, _brew_commands())
Beispiel #9
0
def get_new_command(command):
    pgr = command.script.split()[-1]

    return replace_command(command, pgr, get_pkgfile(pgr))
Beispiel #10
0
def get_new_command(command, settings):
    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))
Beispiel #11
0
def get_new_command(command, settings):
    wrong_command = re.findall(
        r"docker: '(\w+)' is not a docker command.", command.stderr)[0]
    return replace_command(command, wrong_command, get_docker_commands())
def get_new_command(command):
    misspelled_command = re.findall(r"Unrecognized command '(.*)'",
                                    command.output)[0]
    commands = _get_commands()
    return replace_command(command, misspelled_command, commands)
def get_new_command(command):
    interface = command.output.split(' ')[0][:-1]
    possible_interfaces = _get_possible_interfaces()
    return replace_command(command, interface, possible_interfaces)
Beispiel #14
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, ['The most similar command', 'Did you mean'])
    return replace_command(command, broken_cmd, matched)
def get_new_command(command):
    unknown_command = _get_unknown_command(command)
    all_commands = _get_all_commands()
    return replace_command(command, unknown_command, all_commands)
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):
    misspelled_command = re.findall(r'Command `(.*)` unrecognized',
                                    command.stderr)[0]
    commands = re.findall(r'  - (.*): .*\n', command.stdout)
    return replace_command(command, misspelled_command, commands)
def get_new_command(command):
    misspelled_command = regex.findall(command.output)[0]
    return replace_command(command, misspelled_command, _get_operations())
Beispiel #19
0
def get_new_command(command):
    misspelled_script = re.findall(
        r'.*missing script: (.*)\n', command.output)[0]
    return replace_command(command, misspelled_script, get_scripts())
Beispiel #20
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)
Beispiel #21
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)
Beispiel #22
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())
Beispiel #23
0
def get_new_command(command, settings):
    wrong = re.findall(r'`(\w+)` is not a heroku command', command.stderr)[0]
    return replace_command(command, wrong, _get_suggests(command.stderr))
Beispiel #24
0
def get_new_command(command):
    wrong_task = regex.findall(command.output)[0][0]
    all_tasks = _get_all_tasks(command.script_parts[0])
    return replace_command(command, wrong_task, all_tasks)
Beispiel #25
0
def get_new_command(command, settings):
    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)
Beispiel #26
0
def get_new_command(command):
    wrong_command = re.findall(
        r"docker: '(\w+)' is not a docker command.", command.output)[0]
    return replace_command(command, wrong_command, get_docker_commands())
Beispiel #27
0
def get_new_command(command, settings):
    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)
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())
Beispiel #29
0
def get_new_command(command):
    interface = command.stderr.split(' ')[0][:-1]
    possible_interfaces = _get_possible_interfaces()
    return replace_command(command, interface, possible_interfaces)