diff options
| author | bwarsaw | 2002-03-07 05:53:21 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-03-07 05:53:21 +0000 |
| commit | ccee4565daf5537d19996ee11b45085c6ea3d024 (patch) | |
| tree | 3d905514325f0c94270dcd7450abca6540a0a669 | |
| parent | d3ee46a9bb1940dfeec09fb4acb5424da3630568 (diff) | |
| download | mailman-ccee4565daf5537d19996ee11b45085c6ea3d024.tar.gz mailman-ccee4565daf5537d19996ee11b45085c6ea3d024.tar.zst mailman-ccee4565daf5537d19996ee11b45085c6ea3d024.zip | |
| -rwxr-xr-x | bin/list_members | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/bin/list_members b/bin/list_members index aaddfd6fa..00dc40009 100755 --- a/bin/list_members +++ b/bin/list_members @@ -107,45 +107,48 @@ def main(): if not args: usage(0) - try: - while 1: + while 1: + try: opt = args.pop(0) - if opt in ('-h', '--help'): - usage(0) - elif opt in ('-p', '--preserve'): - preserve = 1 - elif opt in ('-r', '--regular'): - regular = 1 - elif opt in ('-o', '--output'): + except IndexError: + usage(1) + if opt in ('-h', '--help'): + usage(0) + elif opt in ('-p', '--preserve'): + preserve = 1 + elif opt in ('-r', '--regular'): + regular = 1 + elif opt in ('-o', '--output'): + try: outfile = args.pop(0) - elif opt == '-n': - nomail = 1 - if args and args[0] in WHYCHOICES.keys(): - why = args.pop(0) - elif opt.startswith('--nomail'): - nomail = 1 - i = opt.find('=') - if i >= 0: - why = opt[i+1:] - if why not in WHYCHOICES.keys(): - usage(1, _('Bad --nomail option: %(why)s')) - elif opt == '-d': - digest = 1 - if args and args[0] in ('mime', 'plain'): - kind = args.pop(0) - elif opt.startswith('--digest'): - digest = 1 - i = opt.find('=') - if i >= 0: - kind = opt[i+1:] - if kind not in ('mime', 'plain'): - usage(1, _('Bad --digest option: %(kind)s')) - else: - # No more options left, push the last one back on the list - args.insert(0, opt) - break - except IndexError: - usage(1) + except IndexError: + usage(1) + elif opt == '-n': + nomail = 1 + if args and args[0] in WHYCHOICES.keys(): + why = args.pop(0) + elif opt.startswith('--nomail'): + nomail = 1 + i = opt.find('=') + if i >= 0: + why = opt[i+1:] + if why not in WHYCHOICES.keys(): + usage(1, _('Bad --nomail option: %(why)s')) + elif opt == '-d': + digest = 1 + if args and args[0] in ('mime', 'plain'): + kind = args.pop(0) + elif opt.startswith('--digest'): + digest = 1 + i = opt.find('=') + if i >= 0: + kind = opt[i+1:] + if kind not in ('mime', 'plain'): + usage(1, _('Bad --digest option: %(kind)s')) + else: + # No more options left, push the last one back on the list + args.insert(0, opt) + break if len(args) <> 1: usage(1) |
