Skip to content

Commit

Permalink
Add 'autoremove' to yum --help output. BZ 1053348
Browse files Browse the repository at this point in the history
  • Loading branch information
megaumi committed Feb 17, 2014
1 parent 221d46d commit aed3845
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(self):
self.registerCommand(yumcommands.InfoCommand())
self.registerCommand(yumcommands.ListCommand())
self.registerCommand(yumcommands.EraseCommand())
self.registerCommand(yumcommands.AutoremoveCommand())
self.registerCommand(yumcommands.GroupsCommand())
self.registerCommand(yumcommands.MakeCacheCommand())
self.registerCommand(yumcommands.CleanCommand())
Expand Down
23 changes: 21 additions & 2 deletions yumcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,8 @@ def getNames(self):
:return: a list containing the names of this command
"""
return ['erase', 'remove', 'autoremove',
return ['erase', 'remove',
'erase-n', 'erase-na', 'erase-nevra',
'autoremove-n', 'autoremove-na', 'autoremove-nevra',
'remove-n', 'remove-na', 'remove-nevra']

def getUsage(self):
Expand Down Expand Up @@ -881,6 +880,26 @@ def needTsRemove(self, base, basecmd, extcmds):
"""
return True


class AutoremoveCommand(EraseCommand):
"""A class containing methods needed by the cli to execute the
autremove command.
"""
def getNames(self):
"""Return a list containing the names of this command. This
command can be called from the command line by using any of these names.
:return: a list containing the names of this command
"""
return [ 'autoremove', 'autoremove-n', 'autoremove-na', 'autoremove-nevra']

def getSummary(self):
"""Return a one line summary of this command.
:return: a one line summary of this command
"""
return _("Remove leaf packages")


class GroupsCommand(YumCommand):
""" Single sub-command interface for most groups interaction. """
Expand Down

0 comments on commit aed3845

Please sign in to comment.