Update of /cvsroot/cvs-syncmail/syncmail
In directory usw-pr-cvs1:/tmp/cvs-serv28544
Modified Files:
syncmail
Log Message:
Added -S/--subject-prefix option: lets caller supply a string that
is prepended to the subject line of the generated email message.
Index: syncmail
===================================================================
RCS file: /cvsroot/cvs-syncmail/syncmail/syncmail,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- syncmail 23 May 2002 20:21:04 -0000 1.16
+++ syncmail 8 Jul 2002 19:28:52 -0000 1.17
@@ -47,6 +47,10 @@
-u
Produce a unified diff (smaller).
+ -S TEXT
+ --subject-prefix=TEXT
+ Preprend TEXT to the email subject line.
+
--quiet / -q
Don't print as much status to stdout.
@@ -256,14 +260,16 @@
def main():
try:
opts, args = getopt.getopt(
- sys.argv[1:], 'hC:cuqf:',
- ['fromhost=', 'context=', 'cvsroot=', 'help', 'quiet'])
+ sys.argv[1:], 'hC:cuS:qf:',
+ ['fromhost=', 'context=', 'cvsroot=', 'subject-prefix=',
+ 'help', 'quiet'])
except getopt.error, msg:
usage(1, msg)
# parse the options
contextlines = 2
verbose = 1
+ subject_prefix = ""
fromhost = None
for opt, arg in opts:
if opt in ('-h', '--help'):
@@ -277,6 +283,8 @@
contextlines = 2
elif opt == '-u':
contextlines = 0
+ elif opt in ('-S', '--subject-prefix'):
+ subject_prefix = arg
elif opt in ('-q', '--quiet'):
verbose = 0
elif opt in ('-f', '--fromhost'):
@@ -288,7 +296,7 @@
# $CVSROOT, followed by the list of files that are changing.
if not args:
usage(1, 'No CVS module specified')
- subject = args[0]
+ subject = subject_prefix + args[0]
specs = string.split(args[0])
del args[0]
|