| 663 | return sorted(rv) |
| 664 | |
| 665 | def make_context( |
| 666 | self, |
| 667 | info_name: str | None, |
| 668 | args: list[str], |
| 669 | parent: click.Context | None = None, |
| 670 | **extra: t.Any, |
| 671 | ) -> click.Context: |
| 672 | # Set a flag to tell app.run to become a no-op. If app.run was |
| 673 | # not in a __name__ == __main__ guard, it would start the server |
| 674 | # when importing, blocking whatever command is being called. |
| 675 | os.environ["FLASK_RUN_FROM_CLI"] = "true" |
| 676 | |
| 677 | if "obj" not in extra and "obj" not in self.context_settings: |
| 678 | extra["obj"] = ScriptInfo( |
| 679 | create_app=self.create_app, |
| 680 | set_debug_flag=self.set_debug_flag, |
| 681 | load_dotenv_defaults=self.load_dotenv, |
| 682 | ) |
| 683 | |
| 684 | return super().make_context(info_name, args, parent=parent, **extra) |
| 685 | |
| 686 | def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]: |
| 687 | if (not args and self.no_args_is_help) or ( |