diff --git a/thefuck/rules/brew_install.py b/thefuck/rules/brew_install.py index 08d3ea0f..5848764c 100644 --- a/thefuck/rules/brew_install.py +++ b/thefuck/rules/brew_install.py @@ -20,7 +20,7 @@ def _get_formulas(): def _get_similar_formula(formula_name): - return get_closest(formula_name, _get_formulas(), 1, 0.85) + return get_closest(formula_name, _get_formulas(), cutoff=0.85) def match(command): diff --git a/thefuck/utils.py b/thefuck/utils.py index e03aa42f..5610278d 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -86,11 +86,11 @@ def default_settings(params): return decorator(_default_settings) -def get_closest(word, possibilities, n=3, cutoff=0.6, fallback_to_first=True): +def get_closest(word, possibilities, cutoff=0.6, fallback_to_first=True): """Returns closest match or just first from possibilities.""" possibilities = list(possibilities) try: - return difflib_get_close_matches(word, possibilities, n, cutoff)[0] + return difflib_get_close_matches(word, possibilities, 1, cutoff)[0] except IndexError: if fallback_to_first: return possibilities[0]