MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / _build_base_set_parser

Method _build_base_set_parser

cmd2/cmd2.py:4608–4628  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

4606
4607 @classmethod
4608 def _build_base_set_parser(cls) -> Cmd2ArgumentParser:
4609 # When completing value, we recreate the set command parser with a value argument specific to
4610 # the settable being edited. To make this easier, define a base parser with all the common elements.
4611 set_description = Text.assemble(
4612 "Set a settable parameter or show current settings of parameters.",
4613 "\n\n",
4614 (
4615 "Call without arguments for a list of all settable parameters with their values. "
4616 "Call with just param to view that parameter's value."
4617 ),
4618 )
4619 base_set_parser = argparse_utils.DEFAULT_ARGUMENT_PARSER(description=set_description)
4620 base_set_parser.add_argument(
4621 "param",
4622 nargs=argparse.OPTIONAL,
4623 help="parameter to set or view",
4624 choices_provider=cls._get_settable_choices,
4625 table_columns=["Value", "Description"],
4626 )
4627
4628 return base_set_parser
4629
4630 def complete_set_value(
4631 self, text: str, line: str, begidx: int, endidx: int, arg_tokens: Mapping[str, Sequence[str]]

Callers 2

complete_set_valueMethod · 0.95
_build_set_parserMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected