--- a/src/client.py Thu Jun 28 15:33:59 2007 -0700
+++ b/src/client.py Sun Jul 01 12:28:14 2007 -0700
@@ -234,8 +234,8 @@
try:
if len(sys.argv) > 1:
opts, pargs = getopt.getopt(sys.argv[1:], "s:R:")
- except:
- print "pkg: illegal global option(s)"
+ except getopt.GetoptError, e:
+ print "pkg: illegal global option '%s'" % e.opt
usage()
if pargs == None or len(pargs) == 0:
--- a/src/depot.py Thu Jun 28 15:33:59 2007 -0700
+++ b/src/depot.py Sun Jul 01 12:28:14 2007 -0700
@@ -47,6 +47,7 @@
import re
import sha
import shutil
+import sys
import time
import urllib
@@ -246,8 +247,8 @@
for opt, arg in opts:
if opt == "-n":
sys.exit(0)
- except:
- print "pkg.depotd: unknown option"
+ except getopt.GetoptError, e:
+ print "pkg.depotd: unknown option '%s'" % e.opt
usage()
server = BaseHTTPServer.HTTPServer(('', 10000), pkgHandler)
--- a/src/publish.py Thu Jun 28 15:33:59 2007 -0700
+++ b/src/publish.py Sun Jul 01 12:28:14 2007 -0700
@@ -82,8 +82,8 @@
pargs = None
try:
opts, pargs = getopt.getopt(args, "e")
- except:
- print "pkgsend: illegal open option(s)"
+ except getopt.GetoptError, e:
+ print "pkgsend: illegal open option '%s'" % e.opt
usage()
eval_form = True
@@ -131,8 +131,8 @@
abandon = True
if opt == "-t":
trans_id = arg
- except:
- print "pkgsend: illegal option(s) to close"
+ except getopt.GetoptError, e:
+ print "pkgsend: illegal option to close '%s'" % e.opt
usage()
if trans_id == None:
@@ -243,8 +243,8 @@
pargs = None
try:
opts, pargs = getopt.getopt(sys.argv[1:], "s:R:")
- except:
- print "pkgsend: illegal global option(s)"
+ except getopt.GetoptError, e:
+ print "pkgsend: illegal global option '%s'" % e.opt
usage()
if pargs == None or len(pargs) == 0: