1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00

#N/A: Update apt_invalid_operation rule

This commit is contained in:
Vladimir Iakovlev 2017-09-02 10:11:02 +02:00
parent badd5a2aff
commit f20e344663

View File

@ -19,7 +19,8 @@ def _parse_apt_operations(help_text_lines):
line = line.decode().strip()
if is_commands_list and line:
yield line.split()[0]
elif line.startswith('Basic commands:'):
elif line.startswith('Basic commands:') \
or line.startswith('Most used commands:'):
is_commands_list = True
@ -51,6 +52,6 @@ def _get_operations(app):
@sudo_support
def get_new_command(command):
invalid_operation = command.stderr.split()[-1]
invalid_operation = command.output.split()[-1]
operations = _get_operations(command.script_parts[0])
return replace_command(command, invalid_operation, operations)