[yum-git] 2 commits - cli.py yumcommands.py

James Bowes jbowes at linux.duke.edu
Fri Jan 25 14:06:16 UTC 2008


 cli.py         |    1 +
 yumcommands.py |   23 ++++++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 8800e4981bd03bb43240d23cf9b16ad4f107afca
Author: James Bowes <jbowes at redhat.com>
Date:   Fri Jan 25 09:06:02 2008 -0500

    Display command aliases in help

diff --git a/yumcommands.py b/yumcommands.py
index c52d8e4..dde5d7e 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -706,6 +706,14 @@ class HelpCommand(YumCommand):
         if usage is None and summary is None:
             help_output = "No help available for %s" % canonical_name
 
+        command_names = command.getNames()
+        if len(command_names) > 1:
+            if len(command_names) > 2:
+                help_output += "\n\naliases: "
+            else:
+                help_output += "\n\nalias: "
+            help_output += ', '.join(command.getNames()[1:])
+
         return help_output
 
     def doCommand(self, base, basecmd, extcmds):
commit caea1a7e3fe962e07b6b0a6eb0aad145a16f066e
Author: James Bowes <jbowes at redhat.com>
Date:   Fri Jan 25 09:05:49 2008 -0500

    Split out info and list into two commands

diff --git a/cli.py b/cli.py
index a211c7c..ea512bf 100644
--- a/cli.py
+++ b/cli.py
@@ -75,6 +75,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         self.registerCommand(yumcommands.InstallCommand())
         self.registerCommand(yumcommands.UpdateCommand())
         self.registerCommand(yumcommands.InfoCommand())
+        self.registerCommand(yumcommands.ListCommand())
         self.registerCommand(yumcommands.EraseCommand())
         self.registerCommand(yumcommands.GroupCommand())
         self.registerCommand(yumcommands.GroupListCommand())
diff --git a/yumcommands.py b/yumcommands.py
index 81adc28..c52d8e4 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -194,7 +194,7 @@ class UpdateCommand(YumCommand):
 
 class InfoCommand(YumCommand):
     def getNames(self):
-        return ['info', 'list']
+        return ['info']
 
     def getUsage(self):
         return "[PACKAGE|all|installed|updates|extras|obsoletes|recent]"
@@ -212,6 +212,8 @@ class InfoCommand(YumCommand):
             rap = base.listPkgs(ypl.available, 'Available Packages', basecmd)
             rep = base.listPkgs(ypl.extras, 'Extra Packages', basecmd)
             rup = base.listPkgs(ypl.updates, 'Updated Packages', basecmd)
+
+            # XXX put this into the ListCommand at some point
             if len(ypl.obsoletes) > 0 and basecmd == 'list': 
             # if we've looked up obsolete lists and it's a list request
                 rop = [0, '']
@@ -235,6 +237,17 @@ class InfoCommand(YumCommand):
         
         return True
 
+class ListCommand(InfoCommand):
+    def getNames(self):
+        return ['list']
+
+    def getUsage(self):
+        return "[PACKAGE|all|installed|updates|extras|obsoletes|recent]"
+
+    def getSummary(self):
+        return "List a package or groups of packages"
+
+
 class EraseCommand(YumCommand):
         
     def getNames(self):



More information about the Yum-cvs-commits mailing list