.. _jgdv.cli.parser_model: ===================== jgdv.cli.parser_model ===================== .. py:module:: jgdv.cli.parser_model Classes ------- .. autoapisummary:: jgdv.cli.parser_model.CLIParserModel Module Contents =============== .. _jgdv.cli.parser_model.CLIParserModel: .. py:class:: CLIParserModel # {prog} {args} {cmd} {cmd_args} # {prog} {args} [{task} {tasks_args}] - implicit do cmd .. py:method:: _cmd_at_front() -> .. py:method:: _has_help_flag_at_tail() -> .. py:method:: _has_more_args() -> .. py:method:: _has_no_specs() -> .. py:method:: _insert_implicit_cmd() -> .. py:method:: _insert_implicit_sub() -> .. py:method:: _kwarg_at_front() -> See if theres a kwarg to parse .. py:method:: _no_cmd() -> .. py:method:: _no_sub() -> .. py:method:: _posarg_at_front() -> .. py:method:: _prep_cmd_lookup(cmds) -> get the param specs for each cmd .. py:method:: _prep_prog_lookup(prog) -> .. py:method:: _prep_sub_lookup(subs) -> for each sub cmd, get it's param specs, but also register the parent cmd constraint .. py:method:: _prog_at_front() -> .. py:method:: _separator_at_front() -> .. py:method:: _sub_at_front() -> .. py:method:: cleanup() -> .. py:method:: clear_section() -> .. py:method:: initialise_section() -> .. py:method:: parse_kwarg() -> try each param until one works .. py:method:: parse_posarg() -> .. py:method:: parse_separator() -> .. py:method:: prepare_for_parse(*, prog, cmds, subs, raw_args, implicits = None) -> .. py:method:: report() -> Take the parsed results and return a nested dict .. py:method:: select_cmd_spec() -> .. py:method:: select_prog_spec() -> .. py:method:: select_sub_spec() -> .. py:method:: set_force_help() -> .. py:attribute:: CmdName :type: TypeAlias :value: str .. py:attribute:: SectionTypes :type: ClassVar[type[jgdv.cli._interface.SectionType_e]] .. py:attribute:: SubConstraint :type: TypeAlias :value: tuple[str, ...] .. py:attribute:: SubName :type: TypeAlias :value: str .. py:attribute:: Sub_Params :type: TypeAlias :value: tuple[SubConstraint, list[ParamSpec_i]] .. py:attribute:: _current_data :type: jgdv.Maybe[jgdv.cli._interface.ParseResult_d] .. py:attribute:: _current_section :type: jgdv.Maybe[tuple[str, list[jgdv.cli._interface.ParamSpec_i]]] .. py:attribute:: _force_help :type: bool .. py:attribute:: _help :type: jgdv.cli._interface.ParamSpec_i .. py:attribute:: _processor :type: jgdv.cli.param_spec.param_spec.ParamProcessor .. py:attribute:: _report :type: jgdv.Maybe[jgdv.cli._interface.ParseReport_d] .. py:attribute:: _section_type :type: jgdv.Maybe[jgdv.cli._interface.SectionType_e] .. py:attribute:: _separator :type: jgdv.cli._interface.ParamSpec_i .. py:attribute:: _subs_constraints :type: collections.defaultdict[CLIParserModel.CmdName, set[CLIParserModel.SubName]] .. py:attribute:: args_initial :type: tuple[str, Ellipsis] .. py:attribute:: args_remaining :type: list[str] .. py:attribute:: data_cmds :type: list[jgdv.cli._interface.ParseResult_d] .. py:attribute:: data_prog :type: jgdv.Maybe[jgdv.cli._interface.ParseResult_d] .. py:attribute:: data_subs :type: list[jgdv.cli._interface.ParseResult_d] .. py:attribute:: implicits :type: dict[str, list] .. py:attribute:: specs_cmds :type: dict[CLIParserModel.CmdName, list[jgdv.cli._interface.ParamSpec_i]] .. py:attribute:: specs_prog :type: list[jgdv.cli._interface.ParamSpec_i] .. py:attribute:: specs_prog_prefix :type: list[str] .. py:attribute:: specs_subs :type: dict[CLIParserModel.SubName, list[jgdv.cli._interface.ParamSpec_i]]