[yum-commits] Branch 'yum-3_2_X' - cli.py etc/yum.bash yumcommands.py

Ville Skyttä scop at osuosl.org
Tue Oct 5 18:59:52 UTC 2010


 cli.py         |    3 ++-
 etc/yum.bash   |    6 +++---
 yumcommands.py |    5 +++++
 3 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 1b3faf976122cb407115a8224a35c7601906f93d
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Oct 5 19:47:44 2010 +0300

    Remove localinstall/update from --help and offered bash command completions.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=618154

diff --git a/cli.py b/cli.py
index f667b46..a2a05bd 100644
--- a/cli.py
+++ b/cli.py
@@ -139,7 +139,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         names and summary usages.
         """
         usage = 'yum [options] COMMAND\n\nList of Commands:\n\n'
-        commands = yum.misc.unique(self.yum_cli_commands.values())
+        commands = yum.misc.unique([x for x in self.yum_cli_commands.values()
+                                    if not (hasattr(x, 'hidden') and x.hidden)])
         commands.sort(key=lambda x: x.getNames()[0])
         for command in commands:
             # XXX Remove this when getSummary is common in plugins
diff --git a/etc/yum.bash b/etc/yum.bash
index 01ee3be..25d3cc6 100644
--- a/etc/yum.bash
+++ b/etc/yum.bash
@@ -82,15 +82,15 @@ _yum()
     # Commands offered as completions
     local cmds=( check check-update clean deplist distro-sync downgrade
         groupinfo groupinstall grouplist groupremove help history info install
-        list localinstall localupdate makecache provides reinstall remove
-        repolist resolvedep search shell update upgrade version )
+        list makecache provides reinstall remove repolist resolvedep search
+        shell update upgrade version )
 
     local i c cmd subcmd
     for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
         [[ -n $cmd ]] && subcmd=${COMP_WORDS[i]} && break
         # Recognize additional commands and aliases
         for c in ${cmds[@]} check-rpmdb distribution-synchronization erase \
-            groupupdate grouperase whatprovides ; do
+            groupupdate grouperase localinstall localupdate whatprovides ; do
             [ ${COMP_WORDS[i]} = $c ] && cmd=$c && break
         done
     done
diff --git a/yumcommands.py b/yumcommands.py
index 517e6b9..3c009f8 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -145,6 +145,7 @@ class YumCommand:
         
     def __init__(self):
         self.done_command_once = False
+        self.hidden = False
 
     def doneCommand(self, base, msg, *args):
         if not self.done_command_once:
@@ -711,6 +712,10 @@ class UpgradeCommand(YumCommand):
             return 1, [str(e)]
 
 class LocalInstallCommand(YumCommand):
+    def __init__(self):
+        YumCommand.__init__(self)
+        self.hidden = True
+
     def getNames(self):
         return ['localinstall', 'localupdate']
 


More information about the Yum-commits mailing list