Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core
Commits:
aed587a3 by Abhilash Raj at 2018-05-17T11:49:05Z
Invoke help command when there is no sub-command specified.
Fixes #479
- - - - -
a7de679b by Abhilash Raj at 2018-05-17T13:19:55Z
Merge branch 'issue-479' into 'master'
Invoke help command when there is no sub-command specified.
Closes #479
See merge request mailman/mailman!386
- - - - -
2 changed files:
- src/mailman/bin/mailman.py
- src/mailman/docs/NEWS.rst
Changes:
=====================================
src/mailman/bin/mailman.py
=====================================
--- a/src/mailman/bin/mailman.py
+++ b/src/mailman/bin/mailman.py
@@ -19,6 +19,7 @@
import click
from contextlib import ExitStack
+from mailman.commands.cli_help import help as help_command
from mailman.config import config
from mailman.core.i18n import _
from mailman.core.initialize import initialize
@@ -104,7 +105,8 @@ def initialize_config(ctx, param, value):
is_eager=True, callback=initialize_config)
@click.group(
cls=Subcommands,
- context_settings=dict(help_option_names=['-h', '--help']))
+ context_settings=dict(help_option_names=['-h', '--help']),
+ invoke_without_command=True)
@click.pass_context
@click.version_option(MAILMAN_VERSION_FULL, message='%(version)s')
@public
@@ -116,3 +118,5 @@ def main(ctx, config_file):
http://www.list.org
"""
# click handles dispatching to the subcommand via the Subcommands class.
+ if ctx.invoked_subcommand is None:
+ ctx.invoke(help_command)
=====================================
src/mailman/docs/NEWS.rst
=====================================
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -76,6 +76,8 @@ Bugs
rather than the non-existent ``bin/dumpdb``. (Closes #475)
* The dmarc rule has been fixed to not throw a TypeError when msg.get('from')
returns a header instance. (Closes #477)
+* ``mailman`` command without any sub-command now invokes ``mailman help`` by
+ default. (Closes #479)
Command line
------------
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/b81df81d0c1c759ae2fbfc530c69be535aa41713...a7de679b4d026d2df88fa45618d02b3e60473b4d
--
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/b81df81d0c1c759ae2fbfc530c69be535aa41713...a7de679b4d026d2df88fa45618d02b3e60473b4d
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org