#579: Add missing_space_before_subcommand rule
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from thefuck.utils import get_all_executables, memoize, which
|
||||
|
||||
|
||||
@memoize
|
||||
def _get_executable(script_part):
|
||||
for executable in get_all_executables():
|
||||
if script_part.startswith(executable):
|
||||
return executable
|
||||
|
||||
|
||||
def match(command):
|
||||
return (not which(command.script_parts[0])
|
||||
and _get_executable(command.script_parts[0]))
|
||||
|
||||
|
||||
def get_new_command(command):
|
||||
executable = _get_executable(command.script_parts[0])
|
||||
return command.script.replace(executable, u'{} '.format(executable), 1)
|
||||
Reference in New Issue
Block a user