コード例 #1
0
ファイル: test_utils.py プロジェクト: liu4480/thefuck
def test_get_all_matched_commands(stderr, result):
    assert list(get_all_matched_commands(stderr)) == result
コード例 #2
0
ファイル: lein_not_task.py プロジェクト: bugaevc/thefuck
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)
コード例 #3
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))
コード例 #4
0
ファイル: test_utils.py プロジェクト: yongbinfeng/thefuck
def test_get_all_matched_commands(stderr, result):
    assert list(get_all_matched_commands(stderr)) == result
コード例 #5
0
ファイル: git_not_command.py プロジェクト: tcfunk/thefuck
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)
コード例 #6
0
def get_new_command(command):
    broken_cmd = re.findall(r'tsuru: "([^"]*)" is not a tsuru command',
                            command.output)[0]
    return replace_command(command, broken_cmd,
                           get_all_matched_commands(command.output))
コード例 #7
0
ファイル: tsuru_not_command.py プロジェクト: rayleyva/thefuck
def get_new_command(command, settings):
    broken_cmd = re.findall(r'tsuru: "([^"]*)" is not a tsuru command',
                            command.stderr)[0]
    new_cmd = get_closest(broken_cmd,
                          get_all_matched_commands(command.stderr))
    return replace_argument(command.script, broken_cmd, new_cmd)
コード例 #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, ['The most similar command', 'Did you mean'])
    return replace_command(command, broken_cmd, matched)
コード例 #9
0
ファイル: lein_not_task.py プロジェクト: tcfunk/thefuck
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)
コード例 #10
0
ファイル: git_not_command.py プロジェクト: Googulator/thefuck
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)
コード例 #11
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))
コード例 #12
0
def get_new_command(command):
    broken_cmd = re.findall(r'Error: unknown command "([^"]*)" for "git-lfs"',
                            command.output)[0]
    matched = get_all_matched_commands(command.output,
                                       ['Did you mean', ' for usage.'])
    return replace_command(command, broken_cmd, matched)
コード例 #13
0
def get_new_command(command):
    broken_cmd = re.findall(r"'([^']*)' is not a task", command.output)[0]
    new_cmds = get_all_matched_commands(command.output, "Did you mean this?")
    return replace_command(command, broken_cmd, new_cmds)
コード例 #14
0
ファイル: git_not_command.py プロジェクト: rayleyva/thefuck
def get_new_command(command, settings):
    broken_cmd = re.findall(r"git: '([^']*)' is not a git command",
                            command.stderr)[0]
    new_cmd = get_closest(broken_cmd,
                          get_all_matched_commands(command.stderr))
    return replace_argument(command.script, broken_cmd, new_cmd)