The computed command path. This is used for the ``usage`` information on the help page. It's automatically created by combining the info names of the chain of contexts to the root.
(self)
| 709 | |
| 710 | @property |
| 711 | def command_path(self) -> str: |
| 712 | """The computed command path. This is used for the ``usage`` |
| 713 | information on the help page. It's automatically created by |
| 714 | combining the info names of the chain of contexts to the root. |
| 715 | """ |
| 716 | rv = "" |
| 717 | if self.info_name is not None: |
| 718 | rv = self.info_name |
| 719 | if self.parent is not None: |
| 720 | parent_command_path = [self.parent.command_path] |
| 721 | |
| 722 | if isinstance(self.parent.command, Command): |
| 723 | for param in self.parent.command.get_params(self): |
| 724 | parent_command_path.extend(param.get_usage_pieces(self)) |
| 725 | |
| 726 | rv = f"{' '.join(parent_command_path)} {rv}" |
| 727 | return rv.lstrip() |
| 728 | |
| 729 | def find_root(self) -> Context: |
| 730 | """Finds the outermost context.""" |
nothing calls this directly
no test coverage detected