[Yum-devel] [PATCH 2/2] add cmd option as None to all getUsage() definitions in yumcommands.

Seth Vidal skvidal at fedoraproject.org
Thu Aug 19 02:21:34 UTC 2010


---
 yumcommands.py |   55 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/yumcommands.py b/yumcommands.py
index 5498322..76a12a7 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -154,9 +154,10 @@ class YumCommand:
     def getNames(self):
         return []
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         """
         @return: A usage string for the command, including arguments.
+           cmd = string defining the basecommand to return usage info on: None
         """
         raise NotImplementedError
 
@@ -185,7 +186,7 @@ class InstallCommand(YumCommand):
     def getNames(self):
         return ['install']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return _("PACKAGE...")
 
     def getSummary(self):
@@ -208,7 +209,7 @@ class UpdateCommand(YumCommand):
     def getNames(self):
         return ['update']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return _("[PACKAGE...]")
 
     def getSummary(self):
@@ -230,7 +231,7 @@ class DistroSyncCommand(YumCommand):
     def getNames(self):
         return ['distribution-synchronization', 'distro-sync']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return _("[PACKAGE...]")
 
     def getSummary(self):
@@ -281,7 +282,7 @@ class InfoCommand(YumCommand):
     def getNames(self):
         return ['info']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "[PACKAGE|all|installed|updates|extras|obsoletes|recent]"
 
     def getSummary(self):
@@ -396,7 +397,7 @@ class EraseCommand(YumCommand):
     def getNames(self):
         return ['erase', 'remove']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "PACKAGE..."
 
     def getSummary(self):
@@ -436,7 +437,7 @@ class GroupListCommand(GroupCommand):
     def getNames(self):
         return ['grouplist']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return ""
 
     def getSummary(self):
@@ -456,7 +457,7 @@ class GroupInstallCommand(GroupCommand):
     def getNames(self):
         return ['groupinstall', 'groupupdate']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "GROUP..."
 
     def getSummary(self):
@@ -479,7 +480,7 @@ class GroupRemoveCommand(GroupCommand):
     def getNames(self):
         return ['groupremove', 'grouperase']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "GROUP..."
 
     def getSummary(self):
@@ -507,7 +508,7 @@ class GroupInfoCommand(GroupCommand):
     def getNames(self):
         return ['groupinfo']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "GROUP..."
 
     def getSummary(self):
@@ -532,7 +533,7 @@ class MakeCacheCommand(YumCommand):
     def getNames(self):
         return ['makecache']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return ""
 
     def getSummary(self):
@@ -574,7 +575,7 @@ class CleanCommand(YumCommand):
     def getNames(self):
         return ['clean']
 
-    def getUsage(self):
+    def getUsage(self, cmod=None):
         return "[headers|packages|metadata|dbcache|plugins|expire-cache|all]"
 
     def getSummary(self):
@@ -595,7 +596,7 @@ class ProvidesCommand(YumCommand):
     def getNames(self):
         return ['provides', 'whatprovides']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "SOME_STRING"
     
     def getSummary(self):
@@ -615,7 +616,7 @@ class CheckUpdateCommand(YumCommand):
     def getNames(self):
         return ['check-update']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "[PACKAGE...]"
 
     def getSummary(self):
@@ -668,7 +669,7 @@ class SearchCommand(YumCommand):
     def getNames(self):
         return ['search']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "SOME_STRING"
 
     def getSummary(self):
@@ -691,7 +692,7 @@ class UpgradeCommand(YumCommand):
     def getNames(self):
         return ['upgrade']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return 'PACKAGE...'
 
     def getSummary(self):
@@ -714,7 +715,7 @@ class LocalInstallCommand(YumCommand):
     def getNames(self):
         return ['localinstall', 'localupdate']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "FILE"
 
     def getSummary(self):
@@ -741,7 +742,7 @@ class ResolveDepCommand(YumCommand):
     def getNames(self):
         return ['resolvedep']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "DEPENDENCY"
 
     def getSummary(self):
@@ -758,7 +759,7 @@ class ShellCommand(YumCommand):
     def getNames(self):
         return ['shell']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "[FILENAME]"
 
     def getSummary(self):
@@ -782,7 +783,7 @@ class DepListCommand(YumCommand):
     def getNames(self):
         return ['deplist']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return 'PACKAGE...'
 
     def getSummary(self):
@@ -804,7 +805,7 @@ class RepoListCommand(YumCommand):
     def getNames(self):
         return ('repolist',)
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return '[all|enabled|disabled]'
 
     def getSummary(self):
@@ -1066,7 +1067,7 @@ class HelpCommand(YumCommand):
     def getNames(self):
         return ['help']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "COMMAND"
 
     def getSummary(self):
@@ -1130,7 +1131,7 @@ class ReInstallCommand(YumCommand):
     def getNames(self):
         return ['reinstall']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "PACKAGE..."
 
     def doCheck(self, base, basecmd, extcmds):
@@ -1157,7 +1158,7 @@ class DowngradeCommand(YumCommand):
     def getNames(self):
         return ['downgrade']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "PACKAGE..."
 
     def doCheck(self, base, basecmd, extcmds):
@@ -1184,7 +1185,7 @@ class VersionCommand(YumCommand):
     def getNames(self):
         return ['version']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "[all|installed|available]"
 
     def getSummary(self):
@@ -1328,7 +1329,7 @@ class HistoryCommand(YumCommand):
     def getNames(self):
         return ['history']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "[info|list|summary|redo|undo|new]"
 
     def getSummary(self):
@@ -1406,7 +1407,7 @@ class CheckRpmdbCommand(YumCommand):
     def getNames(self):
         return ['check', 'check-rpmdb']
 
-    def getUsage(self):
+    def getUsage(self, cmd=None):
         return "[dependencies|duplicates|all]"
 
     def getSummary(self):
-- 
1.7.2.1



More information about the Yum-devel mailing list