-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom commands not listed #5673
Comments
I don't think there's anything from Flask's side that can be done. The |
I understand, thanks for that explanation @davidism. |
@davidism I looked at the code that handles making a bare From cli.py L686-L694: 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
# were given as env vars. Otherwise no_args_is_help will not
# see commands from app.cli.
_env_file_option.handle_parse_result(ctx, {}, [])
_app_option.handle_parse_result(ctx, {}, [])
return super().parse_args(ctx, args) |
Hmm, that probably won't work in all cases, but I think it's fine for this where people probably won't be overriding it. Can you create a PR? |
Looks fine, but it will be a while before I have time to merge it and make a release. |
When I run the
flask
command by itself I get help output with all of my custom commands listed. But when I runflask --help
I get the help output with only the built-in flask commands (routes
,run
,shell
). I am using theFLASK_APP
environment variable to load the app.I would think I should get the same help output (showing my custom commands) whether or not I add the
--help
parameter?Environment:
The text was updated successfully, but these errors were encountered: