diff options
| author | Barry Warsaw | 2009-08-16 09:32:10 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-08-16 09:32:10 -0400 |
| commit | 82affb2668ec6fa2d04fe7965a4c317eb13d8fce (patch) | |
| tree | fea7c42631eda905798fedc167ff0dfe35862df3 /src/mailman/commands/cli_lists.py | |
| parent | 592f3d56d2fd87cf06fdeb2bb63907a82ec172b2 (diff) | |
| download | mailman-82affb2668ec6fa2d04fe7965a4c317eb13d8fce.tar.gz mailman-82affb2668ec6fa2d04fe7965a4c317eb13d8fce.tar.zst mailman-82affb2668ec6fa2d04fe7965a4c317eb13d8fce.zip | |
Diffstat (limited to 'src/mailman/commands/cli_lists.py')
| -rw-r--r-- | src/mailman/commands/cli_lists.py | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/src/mailman/commands/cli_lists.py b/src/mailman/commands/cli_lists.py index 9fd401949..b95d1a779 100644 --- a/src/mailman/commands/cli_lists.py +++ b/src/mailman/commands/cli_lists.py @@ -44,31 +44,30 @@ from mailman.interfaces.listmanager import ListAlreadyExistsError class Lists: - """The `lists` subcommand.""" + """List all mailing lists""" implements(ICLISubCommand) - def add(self, parser, subparser): + name = 'lists' + + def add(self, parser, command_parser): """See `ICLISubCommand`.""" - lists_parser = subparser.add_parser( - 'lists', help=_('List all mailing lists')) - lists_parser.set_defaults(func=self.process) - lists_parser.add_argument( + command_parser.add_argument( '-a', '--advertised', default=False, action='store_true', help=_( 'List only those mailing lists that are publicly advertised')) - lists_parser.add_argument( + command_parser.add_argument( '-b', '--bare', default=False, action='store_true', help=_('Show only the list name, with no description')) - lists_parser.add_argument( + command_parser.add_argument( '-d', '--domain', action='append', help=_("""\ List only those mailing lists hosted on the given domain, which must be the email host name. Multiple -d options may be given. """)) - lists_parser.add_argument( + command_parser.add_argument( '-f', '--full', default=False, action='store_true', help=_( @@ -115,22 +114,20 @@ class Lists: class Create: - """The `create` subcommand.""" + """Create a mailing list""" implements(ICLISubCommand) - def add(self, parser, subparser): + name = 'create' + + def add(self, parser, command_parser): """See `ICLISubCommand`.""" - self.parser = parser - create_parser = subparser.add_parser( - 'create', help=_('Create a mailing list')) - create_parser.set_defaults(func=self.process) - create_parser.add_argument( + command_parser.add_argument( '--language', type='unicode', metavar='CODE', help=_("""\ Set the list's preferred language to CODE, which must be a registered two letter language code.""")) - create_parser.add_argument( + command_parser.add_argument( '-o', '--owner', type='unicode', action='append', default=[], dest='owners', metavar='OWNER', help=_("""\ @@ -139,23 +136,23 @@ class Create: linked to a user. Mailman will send a confirmation message to the address, but it will also send a list creation notice to the address. More than one owner can be specified.""")) - create_parser.add_argument( + command_parser.add_argument( '-n', '--notify', default=False, action='store_true', help=_("""\ Notify the list owner by email that their mailing list has been created.""")) - create_parser.add_argument( + command_parser.add_argument( '-q', '--quiet', default=False, action='store_true', help=_('Print less output.')) - create_parser.add_argument( + command_parser.add_argument( '-d', '--domain', default=False, action='store_true', help=_("""\ Register the mailing list's domain if not yet registered.""")) # Required positional argument. - create_parser.add_argument( + command_parser.add_argument( 'listname', metavar='LISTNAME', nargs=1, help=_("""\ The 'fully qualified list name', i.e. the posting address of the @@ -221,28 +218,26 @@ class Create: class Remove: - """The `remove` subcommand.""" + """Remove a mailing list""" implements(ICLISubCommand) - def add(self, parser, subparser): + name = 'remove' + + def add(self, parser, command_parser): """See `ICLISubCommand`.""" - self.parser = parser - remove_parser = subparser.add_parser( - 'remove', help=_('Remove a mailing list')) - remove_parser.set_defaults(func=self.process) - remove_parser.add_argument( + command_parser.add_argument( '-a', '--archives', default=False, action='store_true', help=_("""\ Remove the list's archives too, or if the list has already been deleted, remove any residual archives.""")) - remove_parser.add_argument( + command_parser.add_argument( '-q', '--quiet', default=False, action='store_true', help=_('Suppress status messages')) # Required positional argument. - remove_parser.add_argument( + command_parser.add_argument( 'listname', metavar='LISTNAME', nargs=1, help=_("""\ The 'fully qualified list name', i.e. the posting address of the |
