Parse_Tree Module

author:

Doug Skrypa

class cli_command_parser.parse_tree.AnyWord(nargs: Nargs, remaining: int | float | None = None, n: int = 1)[source]

Bases: object

nargs: Nargs
n: int
remaining: int | float
class cli_command_parser.parse_tree.PosNode(word: Word, param: BasePositional | None, target: Target = None, parent: PosNode | None = None)[source]

Bases: MutableMapping[str | AnyWord | None, PosNode]

param: BasePositional | None
parent: PosNode | None
target: Target
word: Word
nargs_min_and_max() tuple[int, int | float][source]
property any_word: AnyWord[source]
property any_node: PosNode[source]
has_any() bool[source]
property raw_path: tuple[str | AnyWord | None, ...][source]
path_repr() str[source]
classmethod build_tree(command: CommandCls) PosNode[source]
update_node(word: Word, param: BasePositional, target: Target) PosNode[source]
print_tree(indent: int = 0, recursive: bool = True)[source]
cli_command_parser.parse_tree.process_params(command: CommandCls, nodes: Iterable[PosNode], params: Iterable[BasePositional]) set[PosNode][source]
cli_command_parser.parse_tree.process_param(command: CommandCls, nodes: Iterable[PosNode], param: BasePositional) set[PosNode][source]