[Yum] no commands, but some options

Vladimir Bormotov bor at vb.dn.ua
Sun Jul 21 23:32:50 UTC 2002


		Hi!

 example:
 
 $ yum -d 4
 
======== diff === cut ===
--- yum-20020719/yummain.py     Fri Jul 19 07:54:40 2002
+++ yum/yummain.py      Mon Jul 22 02:28:32 2002
@@ -39,10 +39,12 @@
         
     try:
         gopts, cmds = getopt.getopt(args, 'c:hR:e:d:y', ['help'])
+        if len(cmds) < 1:
+            errorlog(0, 'Options Error: no commands found')
+            usage()
     except getopt.error, e:
         errorlog(0, 'Options Error: %s' % e)
         usage()
-        sys.exit(1)
    
     try: 
         for o,a in gopts:
@@ -87,7 +89,6 @@
     except ValueError, e:
         errorlog(0, 'Options Error: %s' % e)
         usage()
-        sys.exit(1)
         
     return (log, errorlog, filelog, conf, cmds)
     
========

 and some clenup: usage() already do sys.exit(1)
 
-- 
		Bor.



More information about the Yum mailing list