diff options
Diffstat (limited to 'src/mailman/commands/cli_help.py')
| -rw-r--r-- | src/mailman/commands/cli_help.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/mailman/commands/cli_help.py b/src/mailman/commands/cli_help.py index 016fc1e23..af0108346 100644 --- a/src/mailman/commands/cli_help.py +++ b/src/mailman/commands/cli_help.py @@ -17,23 +17,27 @@ """The 'help' subcommand.""" +import click + +from mailman.core.i18n import _ from mailman.interfaces.command import ICLISubCommand +from mailman.utilities.options import I18nCommand from public import public from zope.interface import implementer +@click.command( + cls=I18nCommand, + help=_('Show this help message and exit.')) +@click.pass_context +# https://github.com/pallets/click/issues/832 +def help(ctx): # pragma: nocover + click.echo(ctx.parent.get_help(), color=ctx.color) + ctx.exit() + + @public @implementer(ICLISubCommand) class Help: - # Lowercase, to match argparse's default --help text. - """Show this help message and exit.""" - name = 'help' - - def add(self, parser, command_parser): - """See `ICLISubCommand`.""" - self.parser = parser - - def process(self, args): - """See `ICLISubCommand`.""" - self.parser.print_help() + command = help |
