summaryrefslogtreecommitdiff
path: root/cron
diff options
context:
space:
mode:
authorbwarsaw2002-10-21 22:36:58 +0000
committerbwarsaw2002-10-21 22:36:58 +0000
commit17da8273eb61687e1eb7c1e068613036fc1f3f46 (patch)
tree32dbcb9bb3a6bc8726cf9442dca618674cb93544 /cron
parent993c8e5ba7e39b71b219aa20192bc98be7d29db1 (diff)
downloadmailman-17da8273eb61687e1eb7c1e068613036fc1f3f46.tar.gz
mailman-17da8273eb61687e1eb7c1e068613036fc1f3f46.tar.zst
mailman-17da8273eb61687e1eb7c1e068613036fc1f3f46.zip
Jon Parise's patch to improve the usage() output for the command line
and cron scripts. When code/status == 0, there's no error (it's likely --help output) so send that to stdout. Otherwise, it's an error and the output goes to stderr.
Diffstat (limited to 'cron')
-rw-r--r--cron/bumpdigests8
-rw-r--r--cron/disabled8
-rwxr-xr-xcron/gate_news10
-rwxr-xr-xcron/mailpasswds8
-rw-r--r--cron/nightly_gzip8
-rwxr-xr-xcron/senddigests8
6 files changed, 37 insertions, 13 deletions
diff --git a/cron/bumpdigests b/cron/bumpdigests
index b6078f3f9..3636fc6ec 100644
--- a/cron/bumpdigests
+++ b/cron/bumpdigests
@@ -48,9 +48,13 @@ PROGRAM = sys.argv[0]
def usage(code, msg=''):
- print >> sys.stderr, _(__doc__)
+ if code:
+ fd = sys.stderr
+ else:
+ fd = sys.stdout
+ print >> fd, _(__doc__)
if msg:
- print >> sys.stderr, msg
+ print >> fd, msg
sys.exit(code)
diff --git a/cron/disabled b/cron/disabled
index 641438000..dcf05f250 100644
--- a/cron/disabled
+++ b/cron/disabled
@@ -86,9 +86,13 @@ PROGRAM = sys.argv[0]
def usage(code, msg=''):
- print >> sys.stderr, _(__doc__)
+ if code:
+ fd = sys.stderr
+ else:
+ fd = sys.stdout
+ print >> fd, _(__doc__)
if msg:
- print >> sys.stderr, msg
+ print >> fd, msg
sys.exit(code)
diff --git a/cron/gate_news b/cron/gate_news
index ee60c5d2c..3fe466d4a 100755
--- a/cron/gate_news
+++ b/cron/gate_news
@@ -69,10 +69,14 @@ class _ContinueLoop(Exception):
def usage(status, msg=''):
- print >> sys.stderr, _(__doc__)
+ if code:
+ fd = sys.stderr
+ else:
+ fd = sys.stdout
+ print >> fd, _(__doc__)
if msg:
- print msg
- sys.exit(status)
+ print >> fd, msg
+ sys.exit(code)
diff --git a/cron/mailpasswds b/cron/mailpasswds
index 94e19c7b5..5d8b60f6b 100755
--- a/cron/mailpasswds
+++ b/cron/mailpasswds
@@ -67,9 +67,13 @@ _ = i18n._
def usage(code, msg=''):
- print >> sys.stderr, _(__doc__)
+ if code:
+ fd = sys.stderr
+ else:
+ fd = sys.stdout
+ print >> fd, _(__doc__)
if msg:
- print >> sys.stderr, msg
+ print >> fd, msg
sys.exit(code)
diff --git a/cron/nightly_gzip b/cron/nightly_gzip
index 6c532e754..61b641848 100644
--- a/cron/nightly_gzip
+++ b/cron/nightly_gzip
@@ -63,9 +63,13 @@ program = sys.argv[0]
VERBOSE = 0
def usage(code, msg=''):
- print __doc__ % globals()
+ if code:
+ fd = sys.stderr
+ else:
+ fd = sys.stdout
+ print >> fd, _(__doc__) % globals()
if msg:
- print msg
+ print >> fd, msg
sys.exit(code)
diff --git a/cron/senddigests b/cron/senddigests
index 77fc7a642..5f03606b6 100755
--- a/cron/senddigests
+++ b/cron/senddigests
@@ -48,9 +48,13 @@ PROGRAM = sys.argv[0]
def usage(code, msg=''):
- print >> sys.stderr, _(__doc__)
+ if code:
+ fd = sys.stderr
+ else:
+ fd = sys.stdout
+ print >> fd, _(__doc__)
if msg:
- print >> sys.stderr, msg
+ print >> fd, msg
sys.exit(code)