From 6227299d0712a4df282f553045a6fbe0cddfb8a2 Mon Sep 17 00:00:00 2001 From: braham delam Date: Tue, 26 Nov 2019 22:17:33 -0500 Subject: [PATCH] fix small tweak --- .../rules/missing_space_before_subcommand.py | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/thefuck/rules/missing_space_before_subcommand.py b/thefuck/rules/missing_space_before_subcommand.py index da71bfd6..719d45b0 100644 --- a/thefuck/rules/missing_space_before_subcommand.py +++ b/thefuck/rules/missing_space_before_subcommand.py @@ -1,4 +1,3 @@ - from thefuck.utils import get_all_executables, memoize @@ -8,22 +7,11 @@ def _get_executable(script_part): if script_part.startswith(executable): if executable.startswith("apt"): if script_part.startswith("apt-get"): - return "apt-get" - count = 0 - if "g" in script_part: - count += 1 - if "e" in script_part: - count += 1 - if script_part.find("t", 3, -1) != -1: - count += 1 - if "-" in script_part: - count += 1 - if count < 3 or len(script_part) > count + 4: - return executable - - else: - return executable - + if len(script_part)> len("apt-get"): + return "apt-get" + else: + return + return executable def match(command): return (not command.script_parts[0] in get_all_executables() @@ -37,3 +25,10 @@ def get_new_command(command): priority = 4000 + + + + + + +