pg.py: add --continue-after-invalid-message (used to be hardcoded True).
authorW. Trevor King <wking@tremily.us>
Sat, 13 Oct 2012 11:00:27 +0000 (07:00 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 13 Oct 2012 11:00:27 +0000 (07:00 -0400)
bin/pg.py

index 27f7888f4f3a14e4a195bb69c8fbd186c8ed46e6..b8db60eeabe9061747116c56f239a554a3e900f5 100755 (executable)
--- a/bin/pg.py
+++ b/bin/pg.py
@@ -159,6 +159,11 @@ if __name__ == '__main__':
         default=False, action='store_const', const=True,
         help=('Send automatic response emails even if the target has not '
               'registered a PGP key.'))
+    mailpipe_parser.add_argument(
+        '-c', '--continue-after-invalid-message',
+        default=False, action='store_const', const=True,
+        help=('Send responses to invalid messages and continue processing '
+              'further emails (default is to die with an error message).'))
 
     todo_parser = subparsers.add_parser(
         'todo', help=_todo.__doc__.splitlines()[0])
@@ -227,7 +232,8 @@ if __name__ == '__main__':
                     else:
                         kwargs[attr].extend(course.find_people(name=person))
         for attr in ['dry_run', 'mailbox', 'output', 'input_', 'max_late',
-                     'old', 'statistics', 'trust_email_infrastructure']:
+                     'old', 'statistics', 'trust_email_infrastructure',
+                     'continue_after_invalid_message']:
             if hasattr(args, attr):
                 kwargs[attr] = getattr(args, attr)
     elif args.func == _test_smtp:
@@ -239,9 +245,6 @@ if __name__ == '__main__':
             if hasattr(args, attr):
                 kwargs[attr] = getattr(args, attr)
 
-    if args.func == _mailpipe:
-        kwargs['continue_after_invalid_message'] = True
-
     if 'use_color' in func_args:
         kwargs['use_color'] = args.color