diff options
Diffstat (limited to 'bin/list_members')
-rwxr-xr-x | bin/list_members | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/bin/list_members b/bin/list_members index d7cf9329..8995acf2 100755 --- a/bin/list_members +++ b/bin/list_members @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -34,12 +34,6 @@ Where: "plain" which prints just the digest members receiving that kind of digest. - --moderated / -m - Print just the moderated members. - - --non-moderated / -M - Print just the non-moderated members. - --nomail[=why] / -n [why] Print the members that have delivery disabled. Optional argument can be "byadmin", "byuser", "bybounce", or "unknown" which prints just the @@ -54,6 +48,12 @@ Where: Output member addresses case preserved the way they were added to the list. Otherwise, addresses are printed in all lowercase. + --moderated / -m + Print just the moderated members. Ignores -r, -d, -n. + + --non-moderated / -M + Print just the non-moderated members. Ignores -r, -d, -n. + --invalid / -i Print only the addresses in the membership list that are invalid. Ignores -r, -d, -n. @@ -68,9 +68,8 @@ Where: listname is the name of the mailing list to use. -Note that if neither -r or -d is supplied, both regular members are printed -first, followed by digest members, but no indication is given as to address -status. +Note that if neither -r or -d is supplied, regular members are printed first, +followed by digest members, but no indication is given as to address status. """ import sys @@ -181,10 +180,6 @@ def main(): preserve = True elif opt in ('-r', '--regular'): regular = True - elif opt in ('-m', '--moderated'): - moderatedonly = True - elif opt in ('-M', '--non-moderated'): - nonmoderatedonly = True elif opt in ('-o', '--output'): try: outfile = args.pop(0) @@ -212,10 +207,22 @@ def main(): kind = opt[i+1:] if kind not in ('mime', 'plain'): usage(1, _('Bad --digest option: %(kind)s')) + elif opt in ('-m', '--moderated'): + moderatedonly = True + if nonmoderatedonly or invalidonly or unicodeonly: + usage(1, _('Only one of -m, -M, -i or -u may be specified.')) + elif opt in ('-M', '--non-moderated'): + nonmoderatedonly = True + if moderatedonly or invalidonly or unicodeonly: + usage(1, _('Only one of -m, -M, -i or -u may be specified.')) elif opt in ('-i', '--invalid'): invalidonly = True + if moderatedonly or nonmoderatedonly or unicodeonly: + usage(1, _('Only one of -m, -M, -i or -u may be specified.')) elif opt in ('-u', '--unicode'): unicodeonly = True + if moderatedonly or nonmoderatedonly or invalidonly: + usage(1, _('Only one of -m, -M, -i or -u may be specified.')) else: # No more options left, push the last one back on the list args.insert(0, opt) @@ -265,7 +272,8 @@ def main(): showit = True if moderatedonly and mlist.getMemberOption(addr, mm_cfg.Moderate): showit = True - if nonmoderatedonly and not mlist.getMemberOption(addr, mm_cfg.Moderate): + if nonmoderatedonly and not mlist.getMemberOption(addr, + mm_cfg.Moderate): showit = True if showit: print >> fp, formataddr((safe(name), addr)) |