[Zope3-checkins] CVS: Zope3/src/zope/fssync - main.py:1.21
Marius Gedminas
mgedmin@codeworks.lt
Fri, 25 Jul 2003 04:11:27 -0400
Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv5968/src/zope/fssync
Modified Files:
main.py
Log Message:
Make fssync --help display its program name correctly when it is started as
'zsync'. Also fix two small inaccuracies in docstrings.
=== Zope3/src/zope/fssync/main.py 1.20 => 1.21 ===
--- Zope3/src/zope/fssync/main.py:1.20 Mon Jun 30 15:03:58 2003
+++ Zope3/src/zope/fssync/main.py Fri Jul 25 04:11:21 2003
@@ -77,6 +77,8 @@
if argv is None:
argv = sys.argv
+ progname = os.path.split(argv[0])[1]
+
try:
opts, args = getopt.getopt(argv[1:], "h", ["help"])
except getopt.error, msg:
@@ -84,7 +86,7 @@
for o, a in opts:
if o in ("-h", "--help"):
- print __doc__
+ print __doc__.replace("fssync ", progname + " ")
return 0
if not args:
@@ -113,7 +115,8 @@
raise Usage("%s option error: %s", command, msg)
if ("-h", "") in opts or ("--help", "") in opts:
- print handler.__doc__ or "No help for %s" % handler.__name__
+ message = handler.__doc__ or "No help for %s" % handler.__name__
+ print message.replace("fssync ", progname + " ")
return 0
return handler(opts, args)
@@ -170,7 +173,7 @@
in sync with the server.
The -m option specifies a message to label the transaction.
- The default message is 'fssync'.
+ The default message is 'fssync_commit'.
"""
message = "fssync_commit"
raise_on_conflicts = False
@@ -281,7 +284,7 @@
fs.multiple(args, fs.status)
def checkin(opts, args):
- """checkin [-m message] URL [TARGETDIR]
+ """fssync checkin [-m message] URL [TARGETDIR]
URL should be of the form ``http://user:password@host:port/path''.
Only http and https are supported (and https only where Python has