MCPcopy
hub / github.com/pallets/click / command_path

Method command_path

src/click/core.py:711–727  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 2

get_paramsMethod · 0.80
get_usage_piecesMethod · 0.45

Tested by

no test coverage detected