summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/command.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-07-22 03:02:06 +0000
committerBarry Warsaw2017-07-22 03:02:06 +0000
commit02826321d0430d7ffc1f674eeff4221941689ef7 (patch)
tree1a8e56dff0eab71e58e5fc9ecc5f3c614d7edca7 /src/mailman/interfaces/command.py
parentf54c045519300f6f70947d1114f46c2b8ae0d368 (diff)
parentf00b94f18e1d82d1488cbcee6053f03423bc2f49 (diff)
downloadmailman-02826321d0430d7ffc1f674eeff4221941689ef7.tar.gz
mailman-02826321d0430d7ffc1f674eeff4221941689ef7.tar.zst
mailman-02826321d0430d7ffc1f674eeff4221941689ef7.zip
Diffstat (limited to 'src/mailman/interfaces/command.py')
-rw-r--r--src/mailman/interfaces/command.py32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/mailman/interfaces/command.py b/src/mailman/interfaces/command.py
index 4bf0d5e4a..760e5d440 100644
--- a/src/mailman/interfaces/command.py
+++ b/src/mailman/interfaces/command.py
@@ -61,24 +61,22 @@ class IEmailCommand(Interface):
@public
class ICLISubCommand(Interface):
- """A command line interface subcommand."""
+ """A command line interface subcommand.
- name = Attribute('The command name; must be unique')
+ Subcommands are implemented using the `click` package. See
+ http://click.pocoo.org/ for details.
+ """
+ name = Attribute(
+ """The subcommand name as it will show up in `mailman --help`.
- __doc__ = Attribute('The command short help')
+ This must be unique; it is a runtime error if any plugin provides a
+ subcommand with a clashing name.
+ """)
- def add(parser, command_parser):
- """Add the subcommand to the subparser.
+ command = Attribute(
+ """The click command to run for this subcommand.
- :param parser: The argument parser.
- :type parser: `argparse.ArgumentParser`
- :param command_parser: The command subparser.
- :type command_parser: `argparse.ArgumentParser`
- """
-
- def process(args):
- """Process the subcommand.
-
- :param args: The namespace, as passed in by argparse.
- :type args: `argparse.Namespace`
- """
+ This must be a function decorated with at least the @click.command()
+ decorator. The function may also be decorated with other arguments as
+ needed.
+ """)