forked from orbit-oss/flask
Handle help arg by itself the same as no args (#5674)
This commit is contained in:
commit
5ea0ab8ea2
2 changed files with 5 additions and 1 deletions
|
|
@ -4,6 +4,8 @@ Version 3.1.1
|
||||||
Unreleased
|
Unreleased
|
||||||
|
|
||||||
- Fix type hint for `cli_runner.invoke`. :issue:`5645`
|
- Fix type hint for `cli_runner.invoke`. :issue:`5645`
|
||||||
|
- ``flask --help`` loads the app and plugins first to make sure all commands
|
||||||
|
are shown. :issue:5673`
|
||||||
|
|
||||||
|
|
||||||
Version 3.1.0
|
Version 3.1.0
|
||||||
|
|
|
||||||
|
|
@ -684,7 +684,9 @@ class FlaskGroup(AppGroup):
|
||||||
return super().make_context(info_name, args, parent=parent, **extra)
|
return super().make_context(info_name, args, parent=parent, **extra)
|
||||||
|
|
||||||
def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]:
|
def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]:
|
||||||
if not args and self.no_args_is_help:
|
if (not args and self.no_args_is_help) or (
|
||||||
|
len(args) == 1 and args[0] in self.get_help_option_names(ctx)
|
||||||
|
):
|
||||||
# Attempt to load --env-file and --app early in case they
|
# Attempt to load --env-file and --app early in case they
|
||||||
# were given as env vars. Otherwise no_args_is_help will not
|
# were given as env vars. Otherwise no_args_is_help will not
|
||||||
# see commands from app.cli.
|
# see commands from app.cli.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue