diff roundup/scripts/roundup_mailgw.py @ 7066:27c2d7295ba2

Changes from review mailgw script was still using usage()
author Ralf Schlatterbeck <rsc@runtux.com>
date Wed, 23 Nov 2022 21:16:01 +0100
parents 3359dc1dabb0
children f918351a0fe6
line wrap: on
line diff
--- a/roundup/scripts/roundup_mailgw.py	Wed Nov 23 11:23:35 2022 -0500
+++ b/roundup/scripts/roundup_mailgw.py	Wed Nov 23 21:16:01 2022 +0100
@@ -230,7 +230,8 @@
             password = match.group('pass')
             server = match.group('server')
         else:
-            return usage(argv, _('Error: %s specification not valid') % source)
+            cmd.print_help(sys.stderr)
+            return _('\nError: %s specification not valid') % source
 
     # now invoke the mailgw handler depending on the server handler requested
     if source.startswith('pop'):
@@ -253,9 +254,10 @@
             mailbox = args.args[3]
         return handler.do_imap(server, username, password, mailbox, **d)
 
-    return usage(argv, _('Error: The source must be either "mailbox",'
-                         ' "pop", "pops", "apop", "imap", "imaps" or'
-                         ' "imaps_cram'))
+    cmd.print_help(sys.stderr)
+    return _('\nError: The source must be either "mailbox",'
+             ' "pop", "pops", "apop", "imap", "imaps", '
+             ' "imaps_cram", or "imaps_oauth"')
 
 
 def run():

Roundup Issue Tracker: http://roundup-tracker.org/