Exemplo n.º 1
0
    def Visit(self, node, parent, is_group):
        """Visits each node in the CLI command tree to construct the external rep.

    Args:
      node: group/command CommandCommon info.
      parent: The parent Visit() return value, None at the top level.
      is_group: True if node is a group, otherwise its is a command.

    Returns:
      The subtree parent value, used here to construct an external rep node.
    """
        return cli_tree.Command(node, parent)
Exemplo n.º 2
0
    def Visit(self, node, parent, is_group):
        """Implements the Visit method in calliope.walker.Walker.

    Visits each node in the CLI command tree and constructs a cli_tree.Command
    representation of it, minus any hidden flags.

    Args:
      node: calliope.base._Common group/command CommandCommon info.
      parent: The parent Visit() return value, None at the top level.
      is_group: True if node is a group, otherwise it is a command.

    Returns:
      The command path list.
    """
        command = cli_tree.Command(node, parent, include_hidden_flags=False)
        return command