(self, ctx: click.Context)
| 642 | return app.cli.get_command(ctx, name) |
| 643 | |
| 644 | def list_commands(self, ctx: click.Context) -> list[str]: |
| 645 | self._load_plugin_commands() |
| 646 | # Start with the built-in and plugin commands. |
| 647 | rv = set(super().list_commands(ctx)) |
| 648 | info = ctx.ensure_object(ScriptInfo) |
| 649 | |
| 650 | # Add commands provided by the app, showing an error and |
| 651 | # continuing if the app couldn't be loaded. |
| 652 | try: |
| 653 | rv.update(info.load_app().cli.list_commands(ctx)) |
| 654 | except NoAppException as e: |
| 655 | # When an app couldn't be loaded, show the error message |
| 656 | # without the traceback. |
| 657 | click.secho(f"Error: {e.format_message()}\n", err=True, fg="red") |
| 658 | except Exception: |
| 659 | # When any other errors occurred during loading, show the |
| 660 | # full traceback. |
| 661 | click.secho(f"{traceback.format_exc()}\n", err=True, fg="red") |
| 662 | |
| 663 | return sorted(rv) |
| 664 | |
| 665 | def make_context( |
| 666 | self, |
nothing calls this directly
no test coverage detected