1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-20 09:39:01 +00:00
thefuck/thefuck/rules/apt_upgrade.py

17 lines
388 B
Python
Raw Normal View History

from thefuck.specific.apt import apt_available
from thefuck.specific.sudo import sudo_support
from thefuck.utils import for_app
enabled_by_default = apt_available
@sudo_support
@for_app('apt')
def match(command):
return command.script == "apt list --upgradable" and len(command.output.strip().split('\n')) > 1
@sudo_support
def get_new_command(command):
return 'apt upgrade'